5.5.1 Add a Trap Definition

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
duhd
Posts: 27
Joined: Fri May 13, 2016 9:08 am

5.5.1 Add a Trap Definition

Post 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
duhd
Posts: 27
Joined: Fri May 13, 2016 9:08 am

Re: 5.5.1 Add a Trap Definition

Post by duhd »

One Click System test have error
trap.PNG
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: 5.5.1 Add a Trap Definition

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
duhd
Posts: 27
Joined: Fri May 13, 2016 9:08 am

Re: 5.5.1 Add a Trap Definition

Post 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
duhd
Posts: 27
Joined: Fri May 13, 2016 9:08 am

Re: 5.5.1 Add a Trap Definition

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: 5.5.1 Add a Trap Definition

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
duhd
Posts: 27
Joined: Fri May 13, 2016 9:08 am

Re: 5.5.1 Add a Trap Definition

Post 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
You do not have the required permissions to view the files attached to this post.
duhd
Posts: 27
Joined: Fri May 13, 2016 9:08 am

Re: 5.5.1 Add a Trap Definition

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: 5.5.1 Add a Trap Definition

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
duhd
Posts: 27
Joined: Fri May 13, 2016 9:08 am

Re: 5.5.1 Add a Trap Definition

Post 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
You do not have the required permissions to view the files attached to this post.
Locked