net-snmp

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

Re: net-snmp

Post by hanya.radwan »

I follow software support (remote server) and install the following:
rpm -Uvh net-snmp-libs-5.3.2.2-20.el5.i386.rpm
rpm -ivh lm_sensors-2.10.7-9.el5.i386.rpm
rpm -ivh net-snmp-5.3.2.2-20.el5.i386.rpm

then I I add nagios IP to snmp.cfg which related to the software and restart snmpd service, I added it to attached.
but there is important note, the snmptrapd.conf not exits in /etc/snmp/
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: net-snmp

Post by tmcdonald »

Just to confirm, you are checking for these files on the Nagios server, correct?

This command will try to find the snmptrapd.conf file - please run it on your Nagios server:

Code: Select all

find / -name snmptrapd.conf
Can you also run that grep command I posted?

Code: Select all

grep "mode =" /etc/snmp/snmptt.ini
Former Nagios employee
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

Re: net-snmp

Post by hanya.radwan »

hi,

snmp.cfg this file related to the remote server
snmptt.conf this file for nagios (10.102.4.10)

on Nagios server:-

[root@nms ~]# find / -name snmptrapd.conf
/var/lib/net-snmp/snmptrapd.conf
/etc/snmp/snmptrapd.conf
[root@nms ~]#

on remote server:- nothing

[root@mcb1 ~]# find / -name snmptrapd.conf
[root@mcb1 ~]#
----------------------------------------------------------------
on nagios server:-
[root@nms ~]# grep "mode =" /etc/snmp/snmptt.ini
mode = daemon
description_mode = 1
[root@nms ~]#

on remote server:- nothing
[root@mcb1 ~]# grep "mode =" /etc/snmp/snmptt.ini
grep: /etc/snmp/snmptt.ini: No such file or directory
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: net-snmp

Post by sreinhardt »

Let's real quick, go ahead and collect all the base information for snmptt and snmptrapd on your nagios system, to see if it doesn't give us some more information as to why you are not seeing them come in.

Code: Select all

Versions installed

    rpm -qa | grep snmp

Looking for bins:

    ls -lva /usr/local/bin | grep -i 'snmp\|addmib'
    ls -lva /usr/local/sbin | grep -i 'snmp\|addmib'
    ls -lva /usr/sbin | grep -i 'snmp\|addmib'
    cat /etc/snmp/snmptrapd.conf

snmptt\trapd settings and user perms:

    grep -i 'daemon_uid\|mode =' /etc/snmp/snmptt.ini
    grep -i 'exec' /etc/snmp/snmptt.conf | tail -n 10
    grep -i 'nag' /etc/group
    grep -i 'snmp' /etc/group
    ls -lart /usr/local/nagios/var/rw/nagios.cmd

Checking log and spool dirs:

    ll /var/log/snmptt/
    ll -d /var/log/snmptt/
    ll /var/spool/snmptt
    ll -d /var/spool/snmptt

Current service status:

    service snmptt status
    service snmptrapd status
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

Re: net-snmp

Post by hanya.radwan »

Versions installed
[root@nms ~]# rpm -qa | grep snmp
net-snmp-libs-5.5-49.el6_5.2.x86_64
net-snmp-utils-5.5-49.el6_5.2.x86_64
net-snmp-5.5-49.el6_5.2.x86_64
net-snmp-perl-5.5-49.el6_5.2.x86_64
php-snmp-5.3.3-27.el6_5.x86_64
snmptt-1.4-0.9.beta2.el6.noarch
net-snmp-devel-5.5-49.el6_5.2.x86_64
Looking for bins:
[root@nms ~]# ls -lva /usr/local/bin | grep -i 'snmp\|addmib'
-rwxr-xr-x 1 root nagios 804 Jun 10 10:25 addmib
-rwxrw-rw- 1 root root 1321 Jul 4 2013 addmib.nms
-rwxr-xr-x 1 root root 804 Jun 13 2013 addmib.orig
-rwxr-xr-x 1 root root 2078 Jun 10 10:25 snmptraphandling.py
-rwxr-xr-x 1 root root 3381 Jul 10 2013 snmptraphandling.py.nms
-rwxr-xr-x 1 root root 2078 Jul 10 2013 snmptraphandling.py.orig
-rwxr-xr-x 1 root nagios 30438 Jun 10 10:25 snmpttconvertmib
-rwxr-xr-x 1 root root 30438 Sep 15 2013 snmpttconvertmib.1.3
-rwxr-xr-x 1 root root 30775 Sep 15 2013 snmpttconvertmib.1.4_2beta
[root@nms ~]# ls -lva /usr/local/sbin | grep -i 'snmp\|addmib'
-rwxr-xr-x 1 root root 177466 Sep 15 2013 snmptt.1.3
-rwxr-xr-x 1 root root 177466 Sep 15 2013 snmptt.1.4_2beta
[root@nms ~]# ls -lva /usr/sbin | grep -i 'snmp\|addmib'
-rwxr-xr-x 1 root root 30744 Aug 26 22:42 snmpd
-rwxr-xr-x 1 root root 30776 Aug 26 22:42 snmptrapd
-rwxr-xr-x 1 root root 177466 Oct 22 2012 snmptt
-rwxr-xr-x 1 root root 6493 Oct 22 2012 snmptthandler

[root@nms ~]# cat /etc/snmp/snmptrapd.conf
disableAuthorization yes
traphandle default /usr/sbin/snmptthandler

snmptt\trapd settings and user perms:

[root@nms ~]# grep -i 'daemon_uid\|mode =' /etc/snmp/snmptt.ini
mode = daemon
description_mode = 1
# A second (child) process will be started as the daemon_uid user so
daemon_uid = snmptt
[root@nms ~]# grep -i 'exec' /etc/snmp/snmptt.conf | tail -n 10
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "Secondary recording server Recording service is ready to use. $*"
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "Secondary recording server Recording service is not ready to use. $*"
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "Request to start recording service on secondary server. $*"
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "Request to stop recording service on secondary server. $*"
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "Secondary Recording Service Starting. $*"
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "License limit exceeded for secondary server. $*"
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "Screen capture agent desktop is not accessible. $*"
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "A coldStart trap signifies that the SNMP entity, $*"
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "A warmStart trap signifies that the SNMP entity, $*"
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "An authenticationFailure trap signifies that the SNMP $*"
[root@nms ~]# grep -i 'nag' /etc/group
nagios:x:500:nagios,apache,snmptt
nagcmd:x:501:nagios,apache,snmptt
[root@nms ~]# ls -lart /usr/local/nagios/var/rw/nagios.cmd
prw-rw---- 1 nagios nagcmd 0 Sep 18 15:20 /usr/local/nagios/var/rw/nagios.cmd
Checking log and spool dirs:
[root@nms ~]# service snmptt status
snmptt (pid 14364) is running...
[root@nms ~]# service snmptrapd status
snmptrapd (pid 31337) is running...
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: net-snmp

Post by sreinhardt »

Most of that looks pretty good, but you seem to be missing some directories listed there. Try these again:

Code: Select all

Checking log and spool dirs:

    ll /var/log/snmptt/
    ll -d /var/log/snmptt/
    ll /var/spool/snmptt
    ll -d /var/spool/snmptt
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

Re: net-snmp

Post by hanya.radwan »

please check:

[root@nms ~]# ll /var/log/snmptt/
total 136924
-rw-rw-r-- 1 snmptt root 2314188 Sep 21 09:48 snmptt.log
-rw-rw-r-- 1 snmptt root 62259464 Sep 14 03:10 snmptt.log-20140914
-rw-rw-r-- 1 snmptt root 62264130 Sep 21 03:32 snmptt.log-20140921
-rw-rw-r-- 1 snmptt nagios 0 Sep 21 03:32 snmpttsystem.log
-rw-rw-r-- 1 snmptt nagios 189618 Sep 11 11:33 snmpttsystem.log-20140914
-rw-rw-r-- 1 snmptt nagios 40858 Sep 17 12:10 snmpttsystem.log-20140921
-rw-rw-r-- 1 snmptt root 89957 Sep 21 09:46 snmpttunknown.log
-rw-rw-r-- 1 snmptt root 6478701 Sep 14 02:46 snmpttunknown.log-20140914
-rw-rw-r-- 1 snmptt root 6298032 Sep 21 02:07 snmpttunknown.log-20140921
[root@nms ~]# ll -d /var/log/snmptt/
drwxrwxr-x 2 snmptt nagios 4096 Sep 21 03:32 /var/log/snmptt/
[root@nms ~]# ll /var/spool/snmptt
total 4
-rw-r--r-- 1 root root 478 Sep 21 09:48 #snmptt-trap-1411282109685790
[root@nms ~]# ll -d /var/spool/snmptt
drwxrwxr-x 2 snmptt snmptt 13475840 Sep 21 09:48 /var/spool/snmptt
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: net-snmp

Post by sreinhardt »

Well I can see that your traps are coming in and going to both known and unknown logs, the spool directory appears to be getting cleaned out since they are very recent and small numbers. Are you not seeing these results in nagios XI? Have you checked the unconfigured objects Admin page for these entries? If they are not showing in XI, could you also share a few a trap oids that you expect to be seeing?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

Re: net-snmp

Post by hanya.radwan »

no I'm show them in logs and nagios Xi, it seems the remote server not send traps. as I told you that I install net-snmp agent net-snmp-libs,net-snmp-5.3.2.2 but there is folder for snmptrap on the remote server
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: net-snmp

Post by sreinhardt »

There should not be a snmptraps folder on the remote system, you need to configure your applications or OS to handle this. Unfortunately snmpd does not send many if any traps automatically, and snmptt and snmptrapd are intended only for receiving. So either you need another daemon to send traps, or your applications need to be configured to have that as an option, such as calling snmptrap(which is part of net-snmp). Otherwise a base linux system, doesn't really have a way to send traps unless specific applications are handling it themselves.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked