![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Small-scale SNMP reporting | iBot | UNIX and Linux RSS News | 0 | 02-12-2008 12:50 PM |
| sar command not reporting | RobSand | SUN Solaris | 1 | 10-15-2007 11:36 AM |
| Reporting SU and Failedlogins | janet | Shell Programming and Scripting | 1 | 02-24-2006 06:51 AM |
| Progress reporting | Ypnos | UNIX for Dummies Questions & Answers | 9 | 05-28-2003 08:25 AM |
| Reporting | Mike11 | UNIX for Dummies Questions & Answers | 3 | 12-14-2000 07:48 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
SNMP time reporting
Hi,
First post, please bare with me. I am currently using SNMP on Nagios to monitor Exim and all is running great with the exception to it picking up the date / time of the last Exim queue run. What I am hoping to achieve is for SNMP / Nagios to correctly pickup the difference between the current time and the last queue run. I am using the below to capture the date / time value ; Code:
hostname-f:/etc/snmp# cat /var/log/exim4/mainlog|grep "End queue run"|tail -n1|awk '{ print $1, $2 }'
2008-05-22 10:42:58
Code:
bash-2.05# ./check_snmp -H xxx.xxx.xx.xx -o .1.3.6.1.4.1.8072.1.3.2.4.1.2.15.115.110.109.112.95.101.120.105.109.95.115.116.97.116.115.10 -w 10 -c 20 SNMP OK - 10 Any further info required, give me a shout. Many thanks in advance. TheBlueProject |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
It's not perfect but I've found the below does the job.
Instead of doing a date and a time calculation (as I first simply thought of), it will work out the difference in seconds, then divides that by 60, thus displaying the difference in minutes. Code:
$(( $(( $(( $(date --utc +%s)+3600)) - $(grep "End queue run" /var/log/exim4/mainlog |tail -n1|awk '{ print "date --utc --date \""$1" "$2"\" +%s" }'|sh) )) / 60 ))
Last edited by theblueproject; 05-22-2008 at 09:23 AM. Reason: typo |
|||
| Google The UNIX and Linux Forums |