current snmptt.log behind current time

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
biswajit.banerjee
Posts: 152
Joined: Fri Dec 08, 2017 10:24 pm

current snmptt.log behind current time

Post by biswajit.banerjee »

Hi Support ,

Our snmptt log current time of logging data is old ( 2 days back) , not able to understand this .
Capture-11.PNG
Can you please help me diagnose as some time based snmptrap is creating issue .

Thanks
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: current snmptt.log behind current time

Post by ssax »

I've never seen this personally but it could be taking them from the actually time the trap was received.

First, please send the output of these commands:

Code: Select all

mysql -h 127.0.0.1 -uroot -pnagiosxi -e 'SELECT NOW(); SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;'
date
ls -l /etc/localtime
php -r 'echo date("D M j G:i:s T Y")."\n";'
grep "date.timezone =" /etc/php.ini
ls -l /var/spool/snmptt
Does restarting the SNMPTT service fix it?

Code: Select all

service snmptt restart
Thank you
biswajit.banerjee
Posts: 152
Joined: Fri Dec 08, 2017 10:24 pm

Re: current snmptt.log behind current time

Post by biswajit.banerjee »

Please find the required Outputs
# mysql -h 127.0.0.1 -uroot -pnagiosxi -e 'SELECT NOW(); SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;'
+---------------------+
| NOW() |
+---------------------+
| 2020-04-03 10:28:55 |
+---------------------+
+--------------------+---------------------+
| @@GLOBAL.time_zone | @@SESSION.time_zone |
+--------------------+---------------------+
| SYSTEM | SYSTEM |
+--------------------+---------------------+

# date
Fri Apr 3 10:29:48 EDT 2020
# ls -l /etc/localtime
lrwxrwxrwx 1 root root 36 Mar 1 2018 /etc/localtime -> /usr/share/zoneinfo/America/New_York
root@usvanagiospxi3:(04-03 10:28): /root
# php -r 'echo date("D M j G:i:s T Y")."\n";'
Fri Apr 3 10:32:43 EDT 2020
root@usvanagiospxi3:(04-03 10:28): /root
# grep "date.timezone =" /etc/php.ini
date.timezone = America/New_York
# ls -l /var/spool/snmptt | wc -l
763249

# ls -ltur /var/spool/snmptt | tail -10
-rw-r--r-- 1 root root 339 Apr 3 10:40 #snmptt-trap-1585924843214849
-rw-r--r-- 1 root root 317 Apr 3 10:40 #snmptt-trap-1585924843291227
-rw-r--r-- 1 root root 321 Apr 3 10:40 #snmptt-trap-1585924843422659
-rw-r--r-- 1 root root 433 Apr 3 10:40 #snmptt-trap-1585924843466199
-rw-r--r-- 1 root root 317 Apr 3 10:40 #snmptt-trap-1585924843979619
-rw-r--r-- 1 root root 409 Apr 3 10:40 #snmptt-trap-1585924844047428
-rw-r--r-- 1 root root 317 Apr 3 10:40 #snmptt-trap-1585924844225515
-rw-r--r-- 1 root root 320 Apr 3 10:40 #snmptt-trap-1585924844432240
-rw-r--r-- 1 root root 583 Apr 3 10:40 #snmptt-trap-1585924844737205
-rw-r--r-- 1 root root 317 Apr 3 10:40 #snmptt-trap-1585924845055325
Restart of snmptt did not work out
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: current snmptt.log behind current time

Post by ssax »

That all looks proper.

Are you logging the traps to /var/log/messages from snmptrapd? Please check if the times show wrong in there as well.

Please PM me one of the files from /var/spool/snmptt?

Additionally, run this command (as root) and send me the resulting /tmp/SNMPFILES.zip file:

Code: Select all

zip -r /tmp/SNMPFILES.zip /etc/snmp
Locked