SNMP time reporting


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers SNMP time reporting
# 1  
Old 05-22-2008
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

However, when I check the snmp, it only takes the first value from the time (: works as a break);
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

As you can see from my code above I am only trying to get it to display the last date / time as I have no idea where to start with subtracting the values.

Any further info required, give me a shout.

Many thanks in advance.

TheBlueProject
# 2  
Old 05-22-2008
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 ))

Smilie

Last edited by theblueproject; 05-22-2008 at 01:23 PM.. Reason: typo
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need to transfer all kernel logs (var/log/messages) to the snmp listener as snmp trap

i am working with embedded system -Dell DCS management sub system. my question is as below: currently we are using linux kernel 2.6.30 build and we have a kernel logs stored to the /var/log/messages path. now we have to transfer all this logs to the specified SNMP target as a part of SNMP... (4 Replies)
Discussion started by: vipul_prajapati
4 Replies

2. Infrastructure Monitoring

SNMP traps to SNMP server

Dear Champs, I am new to unix, and need to configure linux server to send below traps to a SNMP server. Monitoring TRAP Disk Space Low Monitoring TRAP Memory Low Monitoring TRAP CPU high Monitoring TRAP Admin login/Logoff Please help me how to send this information to my SNMP server... (2 Replies)
Discussion started by: stavar
2 Replies

3. IP Networking

SNMP Problem - SNMP not getting to the agent.

I am having a problem with an SNMP event, and I am not sure where I should be looking to solve this problem. Description: There is an SNMP event in our system that for one reason or another is not getting sent out as an email because it is never getting to our SNMP agent. I see where the... (0 Replies)
Discussion started by: broberts
0 Replies

4. SCO

du and dfspace reporting

Hi, I am using SCO UNIX version 6.0.0 release 5. I am using du and df space to see the used space in the / partition. I am using du -k option to get count in 1024 k so that it directly makes kb. In dfspace I subtracted the used mb from total size mb which should be the used space and then... (40 Replies)
Discussion started by: dextergenious
40 Replies

5. Red Hat

Sending data from DELL OMSA SNMP and Custom SNMP MIB to same UDP port 161

Hi , Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (1 Reply)
Discussion started by: prabakar4all
1 Replies

6. IP Networking

Sending data from DELL OMSA SNMP and Custom SNMP MIB to same UDP port 161

Hi , Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (0 Replies)
Discussion started by: prabakar4all
0 Replies

7. Shell Programming and Scripting

Reporting SU and Failedlogins

Hi:- I am working on an audit report that produces a monthly summary of account activity on a particular AIX host. I am struggling with su activity and failed logins as these tend to come back with more then a month's data. Is there a easy way that these files can be rotated/cleaned out on a... (1 Reply)
Discussion started by: janet
1 Replies

8. UNIX for Dummies Questions & Answers

Progress reporting

Hi everyone, I'm completely new to the board and to UNIX and I have the following question regarding a script I am building. I am trying to copy an entire directory into a new directory and I was wondering if there is any way of printing on screen a progress report, for example a percentage. It... (9 Replies)
Discussion started by: Ypnos
9 Replies

9. UNIX for Dummies Questions & Answers

Reporting

I have to do a lot of reporting for the company that I work for and was wondering if anyone had suggestions for a way to create professional looking reports. I currently use Filepro so much that I rarely see the shell. Any help is appreciated. (3 Replies)
Discussion started by: Mike11
3 Replies
Login or Register to Ask a Question