SNMP Trap setup script is failing

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
kandatih
Posts: 55
Joined: Thu Mar 28, 2019 7:51 pm

SNMP Trap setup script is failing

Post by kandatih »

Hi All,
We did offline install of Nagios XI v5.6.1. After the install we see snmptt service is running and there were config files under /etc/snmp directory. After loading a mib, we see data showing up in /var/log/snmptt/snmptt.log, but we noticed the number of traps shown in snmptt.log is not matching with the traps shown under Home > Notifications window. Notifications window is having less number of traps than shown in the snmptt.log. we see below message when we restart the snmptt service.

========
Mon May 20 09:21:51 2019 SNMPTT v1.4beta2 shutdown
Mon May 20 09:21:51 2019 Total traps received=84832,Total traps translated=6059,Total traps ignored=0,Total unknown traps=78773
Mon May 20 09:21:51 2019 SNMPTT v1.4beta2 started
Mon May 20 09:21:51 2019 Loading /etc/snmp/snmptt.conf
Mon May 20 09:21:51 2019 Finished loading 69 lines from /etc/snmp/snmptt.conf
Mon May 20 09:21:51 2019 Loading /etc/snmp/snmptt.conf.nxti
Mon May 20 09:21:51 2019 Finished loading 431 lines from /etc/snmp/snmptt.conf.nxti
Mon May 20 09:21:51 2019 Could not convert user id 'snmptt' to a numeric UID

====
[zzz@asdf/etc/snmp]$ id snmptt
id: snmptt: no such user
[zzz@asdf/etc/snmp]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.5 (Maipo)


=======

we understand reason for the warning is because the snmptt user is not created as above, so we tried to run NagiosXI-SNMPTrap-setup.sh(because this is script that creates snmptt user as per SNMP Trap config document) and getting below error,
==
Error: nagiosxi-nxti conflicts with snmptt-1.4-0.9.beta2.el7.noarch
==
after debubbing the script we noticed its failing at line 49 - yum install snmptt net-snmp-perl -y

Could you please advise how to fix this error? Thanks in advance for your responses.
kandatih
Posts: 55
Joined: Thu Mar 28, 2019 7:51 pm

Re: SNMP Trap setup script is failing

Post by kandatih »

Appears this is same as https://support.nagios.com/forum/viewto ... 16&t=51218. I dont have access to this topic.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: SNMP Trap setup script is failing

Post by cdienger »

I think this may be a misunderstanding - the snmptt.log is different from notifications and an entry in snmptt.log does not necessarily mean that a notification would be sent. If you do see a problem with the logs/notificiations, can you clarify with examples of the log and notifications what the problem may be?

Make sure you're running "id snmptt" as the root user and also try running "grep snmptt /etc/passwd" to verify if a snmptt user exists on the system.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kandatih
Posts: 55
Joined: Thu Mar 28, 2019 7:51 pm

Re: SNMP Trap setup script is failing

Post by kandatih »

Yep, you could be right about the mismatch of the traps between the snmptt.log and Notifcations windows.

we are seeing below error in the snmpttsystem.log file, and noticed snmptt user dont exists on the server. we are thinking that snmp configuration didnt complete successfully that could be cause for this error.

Error : " Could not convert user id 'snmptt' to a numeric UID"

So we are trying to run NagiosXI-SNMPTrap-setup.sh to complete the setup(which would create snmptt user), but this script is failing because its conflicting with existing package.
"Error: nagiosxi-nxti conflicts with snmptt-1.4-0.9.beta2.el7.noarch"

Output as root user,

Code: Select all

[root@asdf~]# id snmptt
id: snmptt: no such user
[root@asdf~]# grep snmptt /etc/passwd
[root@asdf~]#
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: SNMP Trap setup script is failing

Post by ssax »

These installation steps are no longer required as of Nagios XI 5.5 and newer
That means DON'T run that script again 5.5.X+ systems because they use NXTI.

More than likely you need to do this instead of running the script you're trying to:

Code: Select all

cd /usr/local/nagiosxi/html/includes/components/nxti
rm -f installed.nxti
sh install.sh
Send us the full output.

Please run this command and send us the resulting /tmp/SNMPFILES.zip file so that I can review them:

Code: Select all

zip -r /tmp/SNMPFILES.zip /etc/snmp /usr/share/snmp/mibs
What is the output of this command?

Code: Select all

rpm -qa | grep -i "snmptt\|nxti"
kandatih
Posts: 55
Joined: Thu Mar 28, 2019 7:51 pm

Re: SNMP Trap setup script is failing

Post by kandatih »

Thanks. Yep we are running v5.6.x, so its not required to run the script for this version. Regarding the missing snmtt user, it appears to be an issue with our previous offline install. On a new build after the offline install, we see the snmptt user is created and no errors in snmpttsystem.log.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: SNMP Trap setup script is failing

Post by cdienger »

Is using the newly built system a good fix for you? The user is created when the snmptt package is installed by the install.sh script that @ssax pointed out. I would try following those steps to remove and reinstall it if necessary.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kandatih
Posts: 55
Joined: Thu Mar 28, 2019 7:51 pm

Re: SNMP Trap setup script is failing

Post by kandatih »

Because of other reasons we had to rebuild the system and couldnt try the steps advised by @ssax. Thanks for your help.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: SNMP Trap setup script is failing

Post by cdienger »

Thanks for the update. I will lock the thread at this point. Please open new one if you have any further issues.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked