Ad Widget

Collapse

Get amount of services

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • frater
    Senior Member
    • Oct 2010
    • 340

    #1

    Get amount of services

    I thought it's useful to have a trigger to show you someone added or deleted a service on your linux machine...
    It also detects if the startup script changed the executable flag.
    I'm having it on interval 900 seconds.


    Code:
    UserParameter=os.services, find -L /etc/rc`runlevel | tr -cd 0-9`.d/ -maxdepth 1 -mindepth 1 -type f -name S\* | xargs -i{} readlink -f {} | xargs -i{} stat -c%A {} | grep -c '^...x'

    Trigger: "Amount of startup services has decreased ({ITEM.LASTVALUE1}) on server {HOSTNAME}"

    Code:
    {Template_Linux:os.services.last(#1)}<{Template_Linux:os.services.last(#2)}
    Trigger: "Amount of startup services has increased ({ITEM.LASTVALUE1}) on server {HOSTNAME}"

    Code:
    {Template_Linux:os.services.last(#1)}>{Template_Linux:os.services.last(#2)}
    Last edited by frater; 22-10-2011, 10:42.
    Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP
Working...