Adding servers problem

This support forum board is for questions relating to Nagios Fusion.
alvinh
Posts: 2
Joined: Tue May 06, 2014 1:24 am

Adding servers problem

Post by alvinh »

Hi there,

I have installed Nagios Fusion, but I cant add a server to Nagios Fusion.
The webGUI doesnt say if there is an error or not, it just accept it and shows me an empty table.

I did :

Code: Select all

tail -f /var/log/httpd/error_log
to look for errors.
This is what it gives me:

Code: Select all

[Mon May 05 14:43:51 2014] [error] [client 10.212.134.200] PHP Notice:  unserialize(): Error at offset 5 of 39 bytes in /usr/local/nagiosfusion/html/includes/utils-xmlsysstat.inc.php on line 41, referer: http://10.10.10.2/nagiosfusion/admin/
[Mon May 05 14:43:51 2014] [error] [client 10.212.134.200] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosfusion/html/includes/utils-xmlsysstat.inc.php on line 145, referer: http://10.10.10.2/nagiosfusion/admin/
[Mon May 05 14:43:51 2014] [error] [client 10.212.134.200] PHP Notice:  unserialize(): Error at offset 5 of 168 bytes in /usr/local/nagiosfusion/html/includes/utils-xmlsysstat.inc.php on line 41, referer: http://10.10.10.2/nagiosfusion/admin/
[Mon May 05 14:43:51 2014] [error] [client 10.212.134.200] PHP Notice:  unserialize(): Error at offset 5 of 39 bytes in /usr/local/nagiosfusion/html/includes/utils-xmlsysstat.inc.php on line 41, referer: http://10.10.10.2/nagiosfusion/admin/
[Mon May 05 14:43:51 2014] [error] [client 10.212.134.200] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosfusion/html/includes/utils-xmlsysstat.inc.php on line 145, referer: http://10.10.10.2/nagiosfusion/admin/
[Mon May 05 14:43:51 2014] [error] [client 10.212.134.200] PHP Notice:  unserialize(): Error at offset 5 of 39 bytes in /usr/local/nagiosfusion/html/includes/utils-xmlsysstat.inc.php on line 41, referer: http://10.10.10.2/nagiosfusion/admin/
[Mon May 05 14:43:51 2014] [error] [client 10.212.134.200] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosfusion/html/includes/utils-xmlsysstat.inc.php on line 145, referer: http://10.10.10.2/nagiosfusion/admin/
Any help guys?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Adding servers problem

Post by sreinhardt »

Well, let's start with the basics. What OS and architecture are your fusion and nagios systems? Also what versions of XI and fusion are you presently using with this test?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
alvinh
Posts: 2
Joined: Tue May 06, 2014 1:24 am

Re: Adding servers problem

Post by alvinh »

Thanks for the reply, but I already fixed it with a clean install.
Another problem has surfaced though.. I can't seem to be getting any data on my Nagios Fusion.
I am using Red Hat on both systems (1 fusion V2012R1.7 and 1 Nagios XI V2012R2.9). I have read that you need to create

Code: Select all

/usr/local/nagiosfusion/var/poller.log
but its not saving any data in it.
I have checked the credentials and its the right ones.

thanks guys!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Adding servers problem

Post by slansing »

What is the output of:

Code: Select all

ls -la /usr/local/nagiosfusion/var/poller.log

Code: Select all

 tail -50 /var/log/httpd/error_log
**note, please select the output from the above commands and click the "Code" button in your reply to wrap it neatly.**

Also, verify that your fusion settings for the nagios server are correct:

http://assets.nagios.com/downloads/nagi ... tarted.pdf
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Adding servers problem

Post by lmiltchev »

When you go to: Configure->Server Credentials, do you see the green "OK" check-mark in the "Auth Check" column?

What is the output of the following commands?

Code: Select all

crontab -u nagios -l
ps -ef | grep poller
tail /var/log/cron
tail /usr/local/nagiosfusion/var/poller.log
Be sure to check out our Knowledgebase for helpful articles and solutions!
alepo.prateek
Posts: 6
Joined: Thu Dec 18, 2014 1:33 am

Re: Adding servers problem

Post by alepo.prateek »

HI Nagios Team,

I am still getting the same above mentioned (in first thread) error while adding a new server.

I am not able to add new server in nagios fusion. Currently i am having rhel linux version.

It seems this thread is still not closed.

Do let me know the way forward.

Thanks,
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Adding servers problem

Post by abrist »

Please post the output from the commands that Ludmil requested:
lmiltchev wrote:crontab -u nagios -l
ps -ef | grep poller
tail /var/log/cron
tail /usr/local/nagiosfusion/var/poller.log
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
alepo.prateek
Posts: 6
Joined: Thu Dec 18, 2014 1:33 am

Re: Adding servers problem

Post by alepo.prateek »

HI Nagios Team,
Thanks for your prompt reply .PLease find the belwo output:

[root@localhost nagiosfusion]# crontab -u nagios -l
* * * * * /usr/bin/php -q /usr/local/nagiosfusion/cron/cmdsubsys.php > /usr/local/nagiosfusion/var/cmdsubsys.log 2>&1
* * * * * /usr/bin/php -q /usr/local/nagiosfusion/cron/eventman.php > /usr/local/nagiosfusion/var/eventman.log 2>&1
* * * * * /usr/bin/php -q /usr/local/nagiosfusion/cron/sysstat.php > /usr/local/nagiosfusion/var/sysstat.log 2>&1
*/5 * * * * /usr/bin/php -q /usr/local/nagiosfusion/cron/dbmaint.php > /usr/local/nagiosfusion/var/dbmaint.log 2>&1
*/5 * * * * /usr/bin/php -q /usr/local/nagiosfusion/cron/poller.php > /usr/local/nagiosfusion/var/poller.log 2>&1


[root@localhost nagiosfusion]# ps -ef | grep poller
root 32228 3192 0 10:05 pts/0 00:00:00 grep poller


[root@localhost nagiosfusion]# tail /var/log/cron
Dec 19 10:04:01 localhost CROND[32102]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/sysstat.php > /usr/local/nagiosfusion/var/sysstat.log 2>&1)
Dec 19 10:05:01 localhost CROND[32175]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/eventman.php > /usr/local/nagiosfusion/var/eventman.log 2>&1)
Dec 19 10:05:01 localhost CROND[32176]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/dbmaint.php > /usr/local/nagiosfusion/var/dbmaint.log 2>&1)
Dec 19 10:05:01 localhost CROND[32177]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/sysstat.php > /usr/local/nagiosfusion/var/sysstat.log 2>&1)
Dec 19 10:05:01 localhost CROND[32178]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/poller.php > /usr/local/nagiosfusion/var/poller.log 2>&1)
Dec 19 10:05:01 localhost CROND[32179]: (root) CMD (LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok)
Dec 19 10:05:01 localhost CROND[32180]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/cmdsubsys.php > /usr/local/nagiosfusion/var/cmdsubsys.log 2>&1)
Dec 19 10:06:02 localhost CROND[32263]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/cmdsubsys.php > /usr/local/nagiosfusion/var/cmdsubsys.log 2>&1)
Dec 19 10:06:02 localhost CROND[32262]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/eventman.php > /usr/local/nagiosfusion/var/eventman.log 2>&1)
Dec 19 10:06:02 localhost CROND[32264]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/sysstat.php > /usr/local/nagiosfusion/var/sysstat.log 2>&1)


[root@localhost nagiosfusion]# tail /usr/local/nagiosfusion/var/poller.log
tail: cannot open `/usr/local/nagiosfusion/var/poller.log' for reading: No such file or directory

Think like there us a problem with poller.php . Below is the output generated while executing poller.php manually
[root@localhost nagiosfusion]# /usr/bin/php -q /usr/local/nagiosfusion/cron/poller.php
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/cron/poller.php on line 122
Polling Recent Alerts...
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/html/includes/utils-recentalerts.inc.php on line 29
Polling Top Alert Producers...
TRUNCATING topalertproducers table
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/html/includes/utils-topalertproducers.inc.php on line 36
2 callbacks run
...***GET DATA!***
RUNTIME: 30 INTERVAL: 30 POLL INTERVAL: 30
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/cron/poller.php on line 122
Polling Recent Alerts...
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/html/includes/utils-recentalerts.inc.php on line 29
2 callbacks run
Loop time: 0 seconds
...***GET DATA!***
RUNTIME: 60 INTERVAL: 30 POLL INTERVAL: 30
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/cron/poller.php on line 122
Polling Recent Alerts...
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/html/includes/utils-recentalerts.inc.php on line 29
2 callbacks run
Loop time: 1 seconds

Thanks
alepo.prateek
Posts: 6
Joined: Thu Dec 18, 2014 1:33 am

Re: Adding servers problem

Post by alepo.prateek »

Hi,

Please find the below output :

[root@localhost nagiosfusion]# crontab -u nagios -l
* * * * * /usr/bin/php -q /usr/local/nagiosfusion/cron/cmdsubsys.php > /usr/local/nagiosfusion/var/cmdsubsys.log 2>&1
* * * * * /usr/bin/php -q /usr/local/nagiosfusion/cron/eventman.php > /usr/local/nagiosfusion/var/eventman.log 2>&1
* * * * * /usr/bin/php -q /usr/local/nagiosfusion/cron/sysstat.php > /usr/local/nagiosfusion/var/sysstat.log 2>&1
*/5 * * * * /usr/bin/php -q /usr/local/nagiosfusion/cron/dbmaint.php > /usr/local/nagiosfusion/var/dbmaint.log 2>&1
*/5 * * * * /usr/bin/php -q /usr/local/nagiosfusion/cron/poller.php > /usr/local/nagiosfusion/var/poller.log 2>&1


[root@localhost nagiosfusion]# ps -ef | grep poller
root 32228 3192 0 10:05 pts/0 00:00:00 grep poller


[root@localhost nagiosfusion]# tail /var/log/cron
Dec 19 10:04:01 localhost CROND[32102]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/sysstat.php > /usr/local/nagiosfusion/var/sysstat.log 2>&1)
Dec 19 10:05:01 localhost CROND[32175]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/eventman.php > /usr/local/nagiosfusion/var/eventman.log 2>&1)
Dec 19 10:05:01 localhost CROND[32176]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/dbmaint.php > /usr/local/nagiosfusion/var/dbmaint.log 2>&1)
Dec 19 10:05:01 localhost CROND[32177]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/sysstat.php > /usr/local/nagiosfusion/var/sysstat.log 2>&1)
Dec 19 10:05:01 localhost CROND[32178]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/poller.php > /usr/local/nagiosfusion/var/poller.log 2>&1)
Dec 19 10:05:01 localhost CROND[32179]: (root) CMD (LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok)
Dec 19 10:05:01 localhost CROND[32180]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/cmdsubsys.php > /usr/local/nagiosfusion/var/cmdsubsys.log 2>&1)
Dec 19 10:06:02 localhost CROND[32263]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/cmdsubsys.php > /usr/local/nagiosfusion/var/cmdsubsys.log 2>&1)
Dec 19 10:06:02 localhost CROND[32262]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/eventman.php > /usr/local/nagiosfusion/var/eventman.log 2>&1)
Dec 19 10:06:02 localhost CROND[32264]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/sysstat.php > /usr/local/nagiosfusion/var/sysstat.log 2>&1)


[root@localhost nagiosfusion]# tail /usr/local/nagiosfusion/var/poller.log
tail: cannot open `/usr/local/nagiosfusion/var/poller.log' for reading: No such file or directory

Seems like issue is with poller.php. Below is the output of manual execution of poller.php
[root@localhost nagiosfusion]# /usr/bin/php -q /usr/local/nagiosfusion/cron/poller.php
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/cron/poller.php on line 122
Polling Recent Alerts...
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/html/includes/utils-recentalerts.inc.php on line 29
Polling Top Alert Producers...
TRUNCATING topalertproducers table
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/html/includes/utils-topalertproducers.inc.php on line 36
2 callbacks run
...***GET DATA!***
RUNTIME: 30 INTERVAL: 30 POLL INTERVAL: 30
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/cron/poller.php on line 122
Polling Recent Alerts...
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/html/includes/utils-recentalerts.inc.php on line 29
2 callbacks run
Loop time: 0 seconds
...***GET DATA!***
RUNTIME: 60 INTERVAL: 30 POLL INTERVAL: 30
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/cron/poller.php on line 122
Polling Recent Alerts...
PHP Notice: unserialize(): Error at offset 5 of 314 bytes in /usr/local/nagiosfusion/html/includes/utils-servers.inc.php on line 379
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosfusion/html/includes/utils-recentalerts.inc.php on line 29
2 callbacks run
Loop time: 1 seconds
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Adding servers problem

Post by scottwilkerson »

Can you post the results of the following

Code: Select all

ls -la /usr/local/nagiosfusion
ls -la /usr/local/nagiosfusion/var
chage -l nagios
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked