Hi all,
Thought i'd share this with you;
Check when cfagent as run last. cfshow will output a line per known policy server. This will output the time since the last communication in hours.
The first is the exact output (float), the 2nd is the whole hour part (not rounded up/down) which i am using now
The reason for the regexp is that the output of cfshow differs between cfengine versions and linux distributions.
It has been tested on: RHEL3+4, solaris9+10, debian, ubuntu.
## Outputs last seen in hours (float)
UserParameter=cfengine.lastseen,cfshow -s | sed 's/.*not seen for .\([0-9.]*\).*/\1/' | sort | head -1
## Outputs last seen in hours (full hour/int)
UserParameter=cfengine.lastseen,cfshow -s | sed 's/.*not seen for .\([0-9]*\).*/\1/' | sort | head -1
Anyone else doing cfengine stuff with zabbix?
Thought i'd share this with you;
Check when cfagent as run last. cfshow will output a line per known policy server. This will output the time since the last communication in hours.
The first is the exact output (float), the 2nd is the whole hour part (not rounded up/down) which i am using now
The reason for the regexp is that the output of cfshow differs between cfengine versions and linux distributions.
It has been tested on: RHEL3+4, solaris9+10, debian, ubuntu.
## Outputs last seen in hours (float)
UserParameter=cfengine.lastseen,cfshow -s | sed 's/.*not seen for .\([0-9.]*\).*/\1/' | sort | head -1
## Outputs last seen in hours (full hour/int)
UserParameter=cfengine.lastseen,cfshow -s | sed 's/.*not seen for .\([0-9]*\).*/\1/' | sort | head -1
Anyone else doing cfengine stuff with zabbix?
Comment