Page 1 of 3
5.5.1 Add a Trap Definition
Posted: Fri Jul 20, 2018 2:37 am
by duhd
NagiosXI 5.5.1 I have error when Add a trap definition and Enable Passive Service Setup
SQL Error [nagiosxi] : ERROR: syntax error at or near "LIMIT"
LINE 1: ...ta_event_name = 'NXTI_Event_1' WHERE trapdata_id = 1 LIMIT 1
^
SQL Error [nagiosxi] : ERROR: syntax error at or near "LIMIT"
LINE 1: ...pExampleHeartbeatNotification' WHERE trapdata_id = 1 LIMIT 1
^
SQL Error [nagiosxi] : ERROR: syntax error at or near "LIMIT"
LINE 1: ...a_category = 'NXTI Test Event' WHERE trapdata_id = 1 LIMIT 1
^
SQL Error [nagiosxi] : ERROR: syntax error at or near "LIMIT"
LINE 1: ...T trapdata_severity = 'Normal' WHERE trapdata_id = 1 LIMIT 1
^
SQL Error [nagiosxi] : ERROR: syntax error at or near "LIMIT"
LINE 1: ...ata SET trapdata_raw_data = '' WHERE trapdata_id = 1 LIMIT 1
^
SQL Error [nagiosxi] : ERROR: syntax error at or near "LIMIT"
LINE 1: ...yL05YVElfV3JpdGVfVGVzdCI7fQ==' WHERE trapdata_id = 1 LIMIT 1
^
SQL Error [nagiosxi] : ERROR: syntax error at or near "LIMIT"
LINE 1: ...finition for testing purposes' WHERE trapdata_id = 1 LIMIT 1
^
SQL Error [nagiosxi] : ERROR: syntax error at or near "LIMIT"
LINE 1: ...zard_integration_enabled = '1' WHERE trapdata_id = 1 LIMIT 1
^
SQL Error [nagiosxi] : ERROR: syntax error at or near "LIMIT"
LINE 1: ...gd2l0aCB2YXJpYWJsZXMgJCsqIjt9' WHERE trapdata_id = 1 LIMIT 1
Re: 5.5.1 Add a Trap Definition
Posted: Fri Jul 20, 2018 3:08 am
by duhd
One Click System test have error
trap.PNG
Re: 5.5.1 Add a Trap Definition
Posted: Fri Jul 20, 2018 12:57 pm
by tgriep
I think there could be a permission problem with one of the config files for the SNMP Trap configs which caused it to not send the test trap.
I would need to see the SNMP configuration files and the MIB files from the server so can you run the following 3 commands as root.
Code: Select all
tar cvfz /tmp/snmp.tgz /etc/snmp/*
tar cvfz /tmp/sharesnmp.tgz /usr/share/snmp/mibs/*
tar cvfz /tmp/snmplog.tgz /var/log/snmptt/*
Then post these 3 files so i can check the settings and the MIB files for any errors.
Code: Select all
/tmp/snmp.tgz
/tmp/sharesnmp.tgz
/tmp/snmplog.tgz
Also, can you run the following commands and post the .tmp/info.txt file here?
Code: Select all
ls -al /etc/snmp >/tmp/info.txt
ls -al /usr/share/snmp/mibs >>/tmp/info.txt
echo 'select * from xi_cmp_trapdata;' |mysql -u root -pnagiosxi nagiosxi >>/tmp/info.txt
Thanks
Re: 5.5.1 Add a Trap Definition
Posted: Fri Jul 20, 2018 10:08 pm
by duhd
Code: Select all
[root@nagios ~]# echo 'select * from xi_cmp_trapdata;' |mysql -u root -pnagiosxi nagiosxi >>/tmp/info.txt
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1049 (42000): Unknown database 'nagiosxi'
tgriep wrote:I think there could be a permission problem with one of the config files for the SNMP Trap configs which caused it to not send the test trap.
I would need to see the SNMP configuration files and the MIB files from the server so can you run the following 3 commands as root.
Code: Select all
tar cvfz /tmp/snmp.tgz /etc/snmp/*
tar cvfz /tmp/sharesnmp.tgz /usr/share/snmp/mibs/*
tar cvfz /tmp/snmplog.tgz /var/log/snmptt/*
Then post these 3 files so i can check the settings and the MIB files for any errors.
Code: Select all
/tmp/snmp.tgz
/tmp/sharesnmp.tgz
/tmp/snmplog.tgz
Also, can you run the following commands and post the .tmp/info.txt file here?
Code: Select all
ls -al /etc/snmp >/tmp/info.txt
ls -al /usr/share/snmp/mibs >>/tmp/info.txt
echo 'select * from xi_cmp_trapdata;' |mysql -u root -pnagiosxi nagiosxi >>/tmp/info.txt
Thanks
Re: 5.5.1 Add a Trap Definition
Posted: Fri Jul 20, 2018 10:16 pm
by duhd
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| nagios |
| nagiosna |
| nagiosql |
| performance_schema |
| sys |
| test |
+--------------------+
8 rows in set (0.01 sec)
duhd wrote:Code: Select all
[root@nagios ~]# echo 'select * from xi_cmp_trapdata;' |mysql -u root -pnagiosxi nagiosxi >>/tmp/info.txt
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1049 (42000): Unknown database 'nagiosxi'
tgriep wrote:I think there could be a permission problem with one of the config files for the SNMP Trap configs which caused it to not send the test trap.
I would need to see the SNMP configuration files and the MIB files from the server so can you run the following 3 commands as root.
Code: Select all
tar cvfz /tmp/snmp.tgz /etc/snmp/*
tar cvfz /tmp/sharesnmp.tgz /usr/share/snmp/mibs/*
tar cvfz /tmp/snmplog.tgz /var/log/snmptt/*
Then post these 3 files so i can check the settings and the MIB files for any errors.
Code: Select all
/tmp/snmp.tgz
/tmp/sharesnmp.tgz
/tmp/snmplog.tgz
Also, can you run the following commands and post the .tmp/info.txt file here?
Code: Select all
ls -al /etc/snmp >/tmp/info.txt
ls -al /usr/share/snmp/mibs >>/tmp/info.txt
echo 'select * from xi_cmp_trapdata;' |mysql -u root -pnagiosxi nagiosxi >>/tmp/info.txt
Thanks
Re: 5.5.1 Add a Trap Definition
Posted: Mon Jul 23, 2018 8:48 am
by tgriep
Your server is probably still using the Postgres database for the nagiosxi database so you will have to run this command instead.
Code: Select all
echo 'select * from xi_cmp_trapdata;' |psql nagiosxi nagiosxi >>/tmp/info.txt
Re: 5.5.1 Add a Trap Definition
Posted: Mon Jul 23, 2018 9:35 pm
by duhd
here al file you need.
info.rar
sharesnmp.tgz
snmp.tgz
tgriep wrote:Your server is probably still using the Postgres database for the nagiosxi database so you will have to run this command instead.
Code: Select all
echo 'select * from xi_cmp_trapdata;' |psql nagiosxi nagiosxi >>/tmp/info.txt
Re: 5.5.1 Add a Trap Definition
Posted: Mon Jul 23, 2018 9:36 pm
by duhd
snmplog.tgz
duhd wrote:here al file you need.
info.rar
sharesnmp.tgz
snmp.tgz
tgriep wrote:Your server is probably still using the Postgres database for the nagiosxi database so you will have to run this command instead.
Code: Select all
echo 'select * from xi_cmp_trapdata;' |psql nagiosxi nagiosxi >>/tmp/info.txt
Re: 5.5.1 Add a Trap Definition
Posted: Tue Jul 24, 2018 2:50 pm
by tgriep
Run this command as root to manually add a trap to the database and go in to the Admin > SNMP Trap Interface menu in the gui and see if there is a received trap called "Test Event"
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.int
ernet.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 you do not see it, run the following 2 commands and post the /tmp/info.txt file so we can see the database settings.
Code: Select all
echo 'select * from xi_cmp_trapdata_log;' |psql nagiosxi nagiosxi >/tmp/info.txt
echo '\d xi_cmp_trapdata_log;' |psql nagiosxi nagiosxi >>/tmp/info.txt
Re: 5.5.1 Add a Trap Definition
Posted: Thu Jul 26, 2018 1:17 am
by duhd
Error happen:
Code: Select all
[root@nagios ~]# 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"
<p><pre>SQL Error [nagiosxi] : ERROR: value too long for type character varying(100)</pre></p>
info.txt
tgriep wrote:Run this command as root to manually add a trap to the database and go in to the Admin > SNMP Trap Interface menu in the gui and see if there is a received trap called "Test Event"
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.int
ernet.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 you do not see it, run the following 2 commands and post the /tmp/info.txt file so we can see the database settings.
Code: Select all
echo 'select * from xi_cmp_trapdata_log;' |psql nagiosxi nagiosxi >/tmp/info.txt
echo '\d xi_cmp_trapdata_log;' |psql nagiosxi nagiosxi >>/tmp/info.txt