Page 2 of 3

Re: 5.5.1 Add a Trap Definition

Posted: Thu Jul 26, 2018 11:40 am
by tgriep
I think one of the Postgres tables is not large enough to store the data from the nxti.php example so to increase it, run the following as root.

Code: Select all

echo 'ALTER TABLE xi_cmp_trapdata_log ALTER trapdata_log_symbolic_oid TYPE varchar(256);' |psql nagiosxi nagiosxi
Then run the test command again like below.

Code: Select all

php  /usr/local/nagiosxi/scripts/nxti.php --event_name="Test Event"  --event_oid=".1.3.6.1.4.1.8072.2.3.0.1" --numeric_oid=".1.3.6.1.4.1.8072.2.3.0.1" --symbolic_oid="NET-SNMP-EXAMPLES-MIB::.iso.org.dod.internet.private.enterprises.netSnmp.netSnmpExamples.netSnmpExampleNotifications.netSnmpExampleNotificationPrefix.netSnmpExampleHeartbeatNotification" --community="" --trap_hostname="localhost" --trap_ip="127.0.0.1" --agent_hostname="localhost" --agent_ip="127.0.0.1" --category="NXTI Test Event" --severity="Normal" --uptime="88:20:29:22.25" --datetime="2018-07-21 10:06:10" --bindings="netSnmpExampleHeartbeatRate:123456"
If it does not error out, go back in to the XI GUI > SNMP Trap Interface menu and try the One click Systems Test and see if it works.

Re: 5.5.1 Add a Trap Definition

Posted: Fri Jul 27, 2018 5:10 am
by duhd
I run

Code: Select all

php  /usr/local/nagiosxi/scripts/nxti.php
does not error out. But try the One click Systems Test not works
tgriep wrote:I think one of the Postgres tables is not large enough to store the data from the nxti.php example so to increase it, run the following as root.

Code: Select all

echo 'ALTER TABLE xi_cmp_trapdata_log ALTER trapdata_log_symbolic_oid TYPE varchar(256);' |psql nagiosxi nagiosxi
Then run the test command again like below.

Code: Select all

php  /usr/local/nagiosxi/scripts/nxti.php --event_name="Test Event"  --event_oid=".1.3.6.1.4.1.8072.2.3.0.1" --numeric_oid=".1.3.6.1.4.1.8072.2.3.0.1" --symbolic_oid="NET-SNMP-EXAMPLES-MIB::.iso.org.dod.internet.private.enterprises.netSnmp.netSnmpExamples.netSnmpExampleNotifications.netSnmpExampleNotificationPrefix.netSnmpExampleHeartbeatNotification" --community="" --trap_hostname="localhost" --trap_ip="127.0.0.1" --agent_hostname="localhost" --agent_ip="127.0.0.1" --category="NXTI Test Event" --severity="Normal" --uptime="88:20:29:22.25" --datetime="2018-07-21 10:06:10" --bindings="netSnmpExampleHeartbeatRate:123456"
If it does not error out, go back in to the XI GUI > SNMP Trap Interface menu and try the One click Systems Test and see if it works.

Re: 5.5.1 Add a Trap Definition

Posted: Fri Jul 27, 2018 1:17 pm
by tgriep
When you ran the nxti.php example, it should of put in an entry in to the database.
Can you go to the SNMP Trap Interface menu in the XI GUI and see if the Test Trap is there?

Re: 5.5.1 Add a Trap Definition

Posted: Sun Jul 29, 2018 11:51 pm
by duhd
tgriep wrote:When you ran the nxti.php example, it should of put in an entry in to the database.
Can you go to the SNMP Trap Interface menu in the XI GUI and see if the Test Trap is there?
Go to the SNMP Trap Interface menu in the XI GUI and see the Test Trap
nagios.PNG

Re: 5.5.1 Add a Trap Definition

Posted: Mon Jul 30, 2018 4:45 pm
by tgriep
Can you run the following commands as root and post the output here?

Code: Select all

ls -l /usr/local/nagiosxi/
ls -l /usr/local/nagiosxi/var/
ps -ef |grep snmp
grep nag /etc/group
Thanks

Re: 5.5.1 Add a Trap Definition

Posted: Mon Jul 30, 2018 9:04 pm
by duhd
Output:

Code: Select all

[root@nagios ~]# ls -l /usr/local/nagiosxi/
total 40
drwxr-xr-x  2 nagios nagios  4096 Jul  2 13:04 cron
drwxr-xr-x  3 nagios nagios  4096 Aug 14  2015 etc
drwxr-x--- 20 nagios nagios  4096 Jul  9 17:31 html
-rw-r--r--  1 nagios nagios     0 Feb  5  2015 is.installed
drwxr-xr-x  3 nagios nagios  4096 Feb  5  2015 nom
drwxr-xr-x  3 nagios nagios  4096 Jul 28 10:18 scripts
drwsrwsr-x  6 nagios nagios 12288 Jul 31 09:01 tmp
drwxr-xr-x  2 nagios nagios  4096 Jun 29  2017 tools
drwxr-xr-x  7 nagios nagios  4096 Jul 31 09:03 var
[root@nagios ~]# ls -l /usr/local/nagiosxi/var/
total 220120
drwxrwxr-x 2 nagios nagios     4096 Jul  2 13:04 certs
-rw-r--r-- 1 nagios nagios   158151 Jul 31 09:03 cleaner.log
-rw-r--r-- 1 nagios nagios  4962162 Aug 20  2017 cleaner.log-20170820
-rw-r--r-- 1 nagios nagios  4463716 Aug 27  2017 cleaner.log-20170827
-rw-r--r-- 1 nagios nagios  4459998 Sep  3  2017 cleaner.log-20170903
-rw-r--r-- 1 nagios nagios  4476820 Sep 10  2017 cleaner.log-20170910
-rw-r--r-- 1 nagios nagios    32019 Jul 31 03:06 cleaner.log-20180731.gz
-rw-r--r-- 1 nagios nagios   910569 Jul 31 09:03 cmdsubsys.log
-rw-r--r-- 1 nagios nagios   422062 Aug 20  2017 cmdsubsys.log-20170820
-rw-r--r-- 1 nagios nagios   323965 Aug 27  2017 cmdsubsys.log-20170827
-rw-r--r-- 1 nagios nagios   284797 Sep  3  2017 cmdsubsys.log-20170903
-rw-r--r-- 1 nagios nagios   298635 Sep 10  2017 cmdsubsys.log-20170910
-rw-r--r-- 1 nagios nagios   181329 Jul 28 04:32 cmdsubsys.log-20180728.gz
drwsrwsr-x 3 apache nagios     4096 Jun 27  2017 components
-rw-r--r-- 1 nagios nagios        8 Jul 31 09:03 corelog.data
-rw-r--r-- 1 nagios nagios     3326 Jul 31 09:03 corelog.diff
-rwxrwxr-x 1 nagios nagios     1569 Jul 31 01:30 corelog.newobjects
-rw-r--r-- 1 nagios nagios   277262 Jul 31 09:00 dbmaint.log
-rw-r--r-- 1 nagios nagios  6668503 Aug 20  2017 dbmaint.log-20170820
-rw-r--r-- 1 nagios nagios  6652628 Aug 27  2017 dbmaint.log-20170827
-rw-r--r-- 1 nagios nagios  6663398 Sep  3  2017 dbmaint.log-20170903
-rw-r--r-- 1 nagios nagios  6684970 Sep 10  2017 dbmaint.log-20170910
-rw-r--r-- 1 nagios nagios   260774 Jul 31 03:06 dbmaint.log-20180731.gz
-rw-r--r-- 1 nagios nagios  3472895 Jul 31 09:03 deadpool.log
-rw-r--r-- 1 nagios nagios    23968 Jul 20 03:50 deadpool.log-20180720.gz
-rw-r--r-- 1 nagios users         0 Jul 31 09:03 event_handler.lock
-rw-r--r-- 1 nagios nagios 12892984 Jul 31 09:03 event_handler.log
-rw-r--r-- 1 nagios nagios  3000528 Jul 31 03:06 event_handler.log-20180731.gz
-rw-r--r-- 1 nagios nagios 12957710 Jul 31 09:03 eventman.log
-rw-r--r-- 1 nagios nagios  2461313 Jul 31 03:06 eventman.log-20180731.gz
-rw-r--r-- 1 nagios nagios  2820252 Jul 31 09:03 feedproc.log
-rw-r--r-- 1 nagios nagios   181404 Aug 20  2017 feedproc.log-20170820
-rw-r--r-- 1 nagios nagios   181170 Aug 27  2017 feedproc.log-20170827
-rw-r--r-- 1 nagios nagios   181278 Sep  3  2017 feedproc.log-20170903
-rw-r--r-- 1 nagios nagios   181926 Sep 10  2017 feedproc.log-20170910
-rw-r--r-- 1 nagios nagios    39586 Jul 17 03:47 feedproc.log-20180717.gz
drwxrwxr-x 2 nagios nagios     4096 Jul  2 13:04 keys
-rw-r--r-- 1 nagios nagios     1344 Jul 31 09:01 load_url.log
-rw-r--r-- 1 nagios nagios     1360 Aug 20  2017 load_url.log-20170820
-rw-r--r-- 1 nagios nagios     1375 Aug 27  2017 load_url.log-20170827
-rw-r--r-- 1 nagios nagios     1213 Sep  3  2017 load_url.log-20170903
-rw-r--r-- 1 nagios nagios     1385 Sep 10  2017 load_url.log-20170910
-rw-r--r-- 1 nagios nagios  4553231 Jul 31 01:10 nom.log
-rw-r--r-- 1 nagios nagios     2175 Aug 19  2017 nom.log-20170820
-rw-r--r-- 1 nagios nagios     1911 Aug 26  2017 nom.log-20170827
-rw-r--r-- 1 nagios nagios     1911 Sep  2  2017 nom.log-20170903
-rw-r--r-- 1 nagios nagios     1911 Sep  9  2017 nom.log-20170910
-rw-rw-rw- 1 nagios nagios     2367 Jul 30 11:49 NXTI_Write_Test
-rw-r--r-- 1 nagios nagios  5126578 Jul 31 09:03 perfdataproc.log
-rw-r--r-- 1 nagios nagios   816318 Aug 20  2017 perfdataproc.log-20170820
-rw-r--r-- 1 nagios nagios   815265 Aug 27  2017 perfdataproc.log-20170827
-rw-r--r-- 1 nagios nagios   815751 Sep  3  2017 perfdataproc.log-20170903
-rw-r--r-- 1 nagios nagios   818667 Sep 10  2017 perfdataproc.log-20170910
-rw-r--r-- 1 nagios nagios   176726 Jul  9 03:44 perfdataproc.log-20180709.gz
-rw-r--r-- 1 nagios nagios  2460490 Jul 31 09:01 recurringdowntime.log
-rw-r--r-- 1 nagios nagios 24912250 Aug 20  2017 recurringdowntime.log-20170820
-rw-r--r-- 1 nagios nagios 24907585 Aug 27  2017 recurringdowntime.log-20170827
-rw-r--r-- 1 nagios nagios 24906958 Sep  3  2017 recurringdowntime.log-20170903
-rw-r--r-- 1 nagios nagios 24901638 Sep 10  2017 recurringdowntime.log-20170910
-rw-r--r-- 1 nagios nagios   765727 Jul  2 03:36 recurringdowntime.log-20180702.gz
-rw-r--r-- 1 nagios nagios  4446904 Jul 19 12:13 reportengine.log
-rw-r--r-- 1 nagios nagios     1050 Aug 11  2017 reportengine.log-20170812
drwxr-xr-x 2 nagios nagios     4096 Jul 29 00:59 subsys
-rw-r--r-- 1 nagios nagios  4767799 Jul 31 09:03 sysstat.log
-rw-r--r-- 1 nagios nagios  3248563 Aug 20  2017 sysstat.log-20170820
-rw-r--r-- 1 nagios nagios  3247858 Aug 27  2017 sysstat.log-20170827
-rw-r--r-- 1 nagios nagios  3241924 Sep  3  2017 sysstat.log-20170903
-rw-r--r-- 1 nagios nagios  3263186 Sep 10  2017 sysstat.log-20170910
-rw-r--r-- 1 nagios nagios    26918 Jul 21 04:30 sysstat.log-20180721.gz
-rw-r--r-- 1 nagios nagios   191954 Jul 19 12:13 upgrade.log
drwxr-xr-x 2 nagios nagios     4096 Jun 15  2016 upgrades
-rw-r--r-- 1 nagios nagios    12146 Jul 27 17:57 xi-sys.cfg
-rw------- 1 nagios nagios       37 Feb 10  2017 xi-uuid
-rw-r--r-- 1 nagios nagios      196 Jul 27 17:57 xiversion
[root@nagios ~]# ps -ef |grep snmp
root     26213     1  0 Jul25 ?        00:00:18 /usr/bin/perl /usr/sbin/snmptt --daemon
snmptt   26214 26213  0 Jul25 ?        00:01:33 /usr/bin/perl /usr/sbin/snmptt --daemon
root     41747 41671  0 09:03 pts/0    00:00:00 grep snmp
root     57361     1  0 Jul02 ?        00:03:16 /usr/sbin/snmptrapd -Lsd -p /var/run/snmptrapd.pid
[root@nagios ~]# grep nag /etc/group
nagios:x:500:nagios,apache,snmptt
nagcmd:x:501:nagios,apache,snmptt
tgriep wrote:Can you run the following commands as root and post the output here?

Code: Select all

ls -l /usr/local/nagiosxi/
ls -l /usr/local/nagiosxi/var/
ps -ef |grep snmp
grep nag /etc/group
Thanks

Re: 5.5.1 Add a Trap Definition

Posted: Tue Jul 31, 2018 8:46 am
by tgriep
Go in to the SNMP Trap Interface and click on the Defined Traps tab.
Search for all of the traps called "NXTI Test Event" and delete them.
Then to to the Advanced Tab and click on the Show FIle Contents button and clear the test file.

Run this in a root shell

Code: Select all

tail -f /var/log/httpd/*_log
Run the One Click Systems Test and post the output of the tail command it is fails.

If it passes, let us know.

Re: 5.5.1 Add a Trap Definition

Posted: Tue Jul 31, 2018 11:20 pm
by duhd
Log http error:

Code: Select all

[Wed Aug 01 11:17:54 2018] [error] [client 172.16.68.223] PHP Notice:  Undefined variable: restart in /usr/local/nagiosxi/html/includes/components/nxti/index.php on line 0, referer: http://10.22.99.50/nagiosxi/includes/components/nxti/index.php
tgriep wrote:Go in to the SNMP Trap Interface and click on the Defined Traps tab.
Search for all of the traps called "NXTI Test Event" and delete them.
Then to to the Advanced Tab and click on the Show FIle Contents button and clear the test file.

Run this in a root shell

Code: Select all

tail -f /var/log/httpd/*_log
Run the One Click Systems Test and post the output of the tail command it is fails.

If it passes, let us know.

Re: 5.5.1 Add a Trap Definition

Posted: Wed Aug 01, 2018 11:57 am
by tgriep
That message is truly just a "PHP Notice" so you can ignore it.

Re: 5.5.1 Add a Trap Definition

Posted: Wed Aug 01, 2018 8:52 pm
by duhd
But the Trap Definition record not deleted.
tgriep wrote:That message is truly just a "PHP Notice" so you can ignore it.