This support forum board is for support questions relating to
Nagios XI , our flagship commercial network monitoring solution.
tgriep
Madmin
Posts: 9190 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Wed Dec 21, 2016 4:04 pm
The script crashed before the var_dump so that didn't help much.
Lets try and add data to the Postgres table manually and see if it gets written.
Run the following as root and post the output.
Code: Select all
echo "INSERT INTO xi_eventqueue (event_time, event_source, event_type, event_meta) VALUES (1482353376, 2, 2, 'test');" |psql nagiosxi nagiosxi
echo 'select * from xi_eventqueue;' | psql nagiosxi nagiosxi
Also, can you post this file from the server?
Code: Select all
/usr/local/nagiosxi/html/config.inc.php
Be sure to check out our
Knowledgebase for helpful articles and solutions!
valmberg
Posts: 49 Joined: Fri May 16, 2014 9:43 pm
Post
by valmberg » Wed Dec 21, 2016 4:17 pm
Here is the output of the insert into xi_eventqueue:
[root@nagios tools]# echo "INSERT INTO xi_eventqueue (event_time, event_source, event_type, event_meta) VALUES (1482353376, 2, 2, 'test');" |psql nagiosxi nagiosxi
INSERT 0 1
[root@nagios tools]# echo 'select * from xi_eventqueue;' | psql nagiosxi nagiosxi
eventqueue_id | event_time | event_source | event_type | event_meta
---------------+------------+--------------+------------+------------
(0 rows)
You do not have the required permissions to view the files attached to this post.
tgriep
Madmin
Posts: 9190 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Wed Dec 21, 2016 5:29 pm
I added more debugging to the handle_nagioscore.inc.php file that is attached to the post.
Upload the file to the /usr/local/nagiosxi/scripts/ folder and run the following to make a backup of the existing file.
Code: Select all
cp /usr/local/nagiosxi/scripts/handle_nagioscore.inc.php /usr/local/nagiosxi/scripts/handle_nagioscore.inc.php.bak
Run this to use the new script
Code: Select all
cp /usr/local/nagiosxi/scripts/handle_nagioscore.inc.php.txt /usr/local/nagiosxi/scripts/handle_nagioscore.inc.php
Then run this to see where it fails in the script.
Code: Select all
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php
echo $?
You do not have the required permissions to view the files attached to this post.
Be sure to check out our
Knowledgebase for helpful articles and solutions!
valmberg
Posts: 49 Joined: Fri May 16, 2014 9:43 pm
Post
by valmberg » Wed Dec 21, 2016 5:44 pm
[root@nagios tools]# /usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php
[root@nagios tools]# echo $?
255
tgriep
Madmin
Posts: 9190 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Thu Dec 22, 2016 11:58 am
I have added more debugging to the handle_nagioscore.inc.php file that is attached to this post, replace the existing one and run the following and post the output. Remember to remove the .txt from the name.
Code: Select all
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php
php -v
You do not have the required permissions to view the files attached to this post.
Be sure to check out our
Knowledgebase for helpful articles and solutions!
valmberg
Posts: 49 Joined: Fri May 16, 2014 9:43 pm
Post
by valmberg » Thu Dec 22, 2016 2:26 pm
[root@nagios tools]# /usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php
[root@nagios tools]# php -v
PHP 5.3.3 (cli) (built: Aug 11 2016 20:33:53)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
tgriep
Madmin
Posts: 9190 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Thu Dec 22, 2016 2:56 pm
Replace this file
/usr/local/nagiosxi/scripts/handle_nagioscore_notification.php
with the one that is attached and post the output after running the command again.
You do not have the required permissions to view the files attached to this post.
Be sure to check out our
Knowledgebase for helpful articles and solutions!
valmberg
Posts: 49 Joined: Fri May 16, 2014 9:43 pm
Post
by valmberg » Thu Dec 22, 2016 3:50 pm
[root@nagios tools]# /usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php
[root@nagios tools]# php -v
PHP 5.3.3 (cli) (built: Aug 11 2016 20:33:53)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
tgriep
Madmin
Posts: 9190 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Thu Dec 22, 2016 4:02 pm
Can you post this file here?
Code: Select all
/usr/local/nagiosxi/scripts/handle_nagioscore_notification.php
Also, run this and post the output here.
Be sure to check out our
Knowledgebase for helpful articles and solutions!
valmberg
Posts: 49 Joined: Fri May 16, 2014 9:43 pm
Post
by valmberg » Thu Dec 22, 2016 6:23 pm
I assume you want the old 'handle_nagioscore_notification.php" file? You sent me one earlier. I've included the new one I uploaded with 'new' in front of the title
[root@nagios tools]# which php
/usr/bin/php
You do not have the required permissions to view the files attached to this post.