Problem with Auto-Discovery

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ditlevw
Posts: 29
Joined: Fri Apr 01, 2011 3:25 am

Re: Problem with Auto-Discovery

Post by ditlevw »

nscott wrote:When you click those gears that are next to the red exclamations, there should be a menu that shows up, allowing you to restart the service. Does it allow you to restart the services?

When the autodiscovery fails, how does it fail? Does it say no hosts found, or does it just spin forever?
Well. I reverted the snapshot of my NagiosXI and I'm running without any of your scripts. I tried to run an Auto Discovery of the same segment that the NagiosXI is running on. This time, it found hosts on the segment!!! I feel like a fool now, even though I'm not sure if I made a mistake. Before reinstalling Nagios, I could leave Auto Discovery for hours, even over night, without ending. As you describe like "spin forever". I did a few tests with different results.
  • Nagios Auto Discover on same segment as Nagios = 15 minutes, 40 hosts
  • Nagios Auto Discover on other segment as Nagios = 10 minutes, 0 hosts (even though I have many hosts here
I'm still trying to find out why Nagios can't "Auto Discover" hosts on segments than the one it's directly connected to. There is no problem if I configure it manually.

Well. ...I still don't know why it didn't work before and why some things still doesn't work. I think we can close this thread for now. I'll keep making snapshots every time I configure anything in Nagios.
Ditlev - Nagios newbie

Nagios XI, 2011R1.6, 32bit

Operating system
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
CentOS release 5.6 (Final)
ditlevw
Posts: 29
Joined: Fri Apr 01, 2011 3:25 am

Re: Problem with Auto-Discovery

Post by ditlevw »

nscott wrote:When you click those gears that are next to the red exclamations, there should be a menu that shows up, allowing you to restart the service. Does it allow you to restart the services?

When the autodiscovery fails, how does it fail? Does it say no hosts found, or does it just spin forever?
Hmmm... Problem with hosts that doesn't disapear still persists. I tried your script again, just to give you an answer on your question about the abillity to restart the services.

The answer is no. I get an error. Actually the total output from the script looks like this:

Code: Select all

[root@localhost tmp]# chmod +x file.php\?id\=750 
[root@localhost tmp]# ./file.php\?id\=750 
chmod: cannot access `/usr/local/nagios/libexec/check_postgres.pl': No such file or directory
chown: cannot access `/usr/local/nagios/libexec/check_postgres.pl': No such file or directory
chmod: cannot access `/usr/local/nagios/libexec/check_sip': No such file or directory
chown: cannot access `/usr/local/nagios/libexec/check_sip': No such file or directory
chmod: cannot access `/usr/local/nagios/libexec/check_mssql': No such file or directory
chown: cannot access `/usr/local/nagios/libexec/check_mssql': No such file or directory
chmod: cannot access `/usr/local/nagios/libexec/check_asterisk.pl': No such file or directory
chown: cannot access `/usr/local/nagios/libexec/check_asterisk.pl': No such file or directory
chmod: cannot access `/usr/local/nagios/libexec/check_mysql_health': No such file or directory
chown: cannot access `/usr/local/nagios/libexec/check_mysql_health': No such file or directory
chmod: cannot access `/usr/local/nagios/var/stats/21854047': No such file or directory
chown: cannot access `/usr/local/nagios/var/stats/21854047': No such file or directory
chmod: cannot access `/usr/local/nagios/var/spool/perfdata/service-perfdata.1311242854': No such file or directory
chown: cannot access `/usr/local/nagios/var/spool/perfdata/service-perfdata.1311242854': No such file or directory
chmod: cannot access `/usr/local/nagios/var/spool/perfdata/host-perfdata.1311242854': No such file or directory
chown: cannot access `/usr/local/nagios/var/spool/perfdata/host-perfdata.1311242854': No such file or directory
chmod: cannot access `/usr/local/nagios/share/images/logos/passivecheck.png': No such file or directory
chown: cannot access `/usr/local/nagios/share/images/logos/passivecheck.png': No such file or directory
chmod: cannot access `/usr/local/nagios/share/images/logos/snmp.png': No such file or directory
chown: cannot access `/usr/local/nagios/share/images/logos/snmp.png': No such file or directory
chmod: cannot access `/usr/local/nagios/share/images/logos/passiveobject.png': No such file or directory
chown: cannot access `/usr/local/nagios/share/images/logos/passiveobject.png': No such file or directory
chmod: cannot access `/usr/local/nagiosxi/nom/checkpoints/nagioscore/1311241099.txt': No such file or directory
chown: cannot access `/usr/local/nagiosxi/nom/checkpoints/nagioscore/1311241099.txt': No such file or directory
chmod: cannot access `/usr/local/nagiosxi/nom/checkpoints/nagioscore/1311241143.tar.gz': No such file or directory
chown: cannot access `/usr/local/nagiosxi/nom/checkpoints/nagioscore/1311241143.tar.gz': No such file or directory
chmod: cannot access `/usr/local/nagiosxi/nom/checkpoints/nagioscore/1311241099.tar.gz': No such file or directory
chown: cannot access `/usr/local/nagiosxi/nom/checkpoints/nagioscore/1311241099.tar.gz': No such file or directory
chmod: cannot access `/usr/local/nagiosxi/nom/checkpoints/nagioscore/1311241143.txt': No such file or directory
chown: cannot access `/usr/local/nagiosxi/nom/checkpoints/nagioscore/1311241143.txt': No such file or directory
chmod +x "/usr/local/nagios/share/perfdata";
chmod +x "/usr/local/nagios/share/perfdata/localhost";
chmod +x "/usr/local/nagios/share/perfdata/1.1.1.1";
chmod +x "/usr/local/nagios/share/perfdata/1.1.1.2";
chmod +x "/usr/local/nagios/share/perfdata/www.google.com";
chmod +x "/usr/local/nagios/share/perfdata/1.1.1.3";
chmod +x "/usr/local/nagios/share/perfdata/.pnp-internal";
chmod +x "/usr/local/nagios/share/perfdata/www.yahoo.com";
chmod +x "/usr/local/nagios/share/perfdata/1.1.1.4";
(IP's slightly modified)
You do not have the required permissions to view the files attached to this post.
Ditlev - Nagios newbie

Nagios XI, 2011R1.6, 32bit

Operating system
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
CentOS release 5.6 (Final)
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Problem with Auto-Discovery

Post by nscott »

Ok, let tackle the Nagios and Database Backend issue first, since that is very important. First, see if either service is running to begin with:

killall -9 nagios
killall -9 ndo2db #These may fail, and thats fine
service nagios status
service ndo2db status

Are they running? If they aren't what happens when you try to restart them? To restart them, use the same code as above, only replace 'status' with 'start'. Are they giving errors back? If they are, whats the result of:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Post the output of the above commands.
Nicholas Scott
Former Nagios employee
ditlevw
Posts: 29
Joined: Fri Apr 01, 2011 3:25 am

Re: Problem with Auto-Discovery

Post by ditlevw »

nscott wrote:Ok, let tackle the Nagios and Database Backend issue first, since that is very important. First, see if either service is running to begin with:

killall -9 nagios
killall -9 ndo2db #These may fail, and thats fine
service nagios status
service ndo2db status

Are they running? If they aren't what happens when you try to restart them? To restart them, use the same code as above, only replace 'status' with 'start'. Are they giving errors back? If they are, whats the result of:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Post the output of the above commands.
Thanks. It looks all fine.

Code: Select all

[root@localhost ~]# killall -9 nagios
[root@localhost ~]# killall -9 ndo2db
[root@localhost ~]# service nagios status
service ndo2db statusnagios is not running
[root@localhost ~]# service ndo2db status
ndo2db is not running but subsystem locked
[root@localhost ~]# service nagios start
Starting nagios: done.
[root@localhost ~]# service ndo2db start
Starting ndo2db: done.
[root@localhost ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Processing object config directory '/usr/local/nagios/etc/static'...
Processing object config file '/usr/local/nagios/etc/static/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.cfg'...
Processing object config file '/usr/local/nagios/etc/contacttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/contactgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/hostgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/servicegroups.cfg'...
Processing object config file '/usr/local/nagios/etc/hosttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicetemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicedependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostdependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/hostescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostextinfo.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceextinfo.cfg'...
Processing object config directory '/usr/local/nagios/etc/hosts'...
Processing object config file '/usr/local/nagios/etc/hosts/10.20.20.2.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/localhost.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/10.197.122.2.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/10.20.20.1.cfg'...
Processing object config directory '/usr/local/nagios/etc/services'...
Processing object config file '/usr/local/nagios/etc/services/10.20.20.2.cfg'...
Processing object config file '/usr/local/nagios/etc/services/localhost.cfg'...
Processing object config file '/usr/local/nagios/etc/services/10.197.122.2.cfg'...
Processing object config file '/usr/local/nagios/etc/services/10.20.20.1.cfg'...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
        Checked 19 services.
Checking hosts...
        Checked 4 hosts.
Checking host groups...
        Checked 3 host groups.
Checking service groups...
        Checked 1 service groups.
Checking contacts...
        Checked 2 contacts.
Checking contact groups...
        Checked 2 contact groups.
Checking service escalations...
        Checked 0 service escalations.
Checking service dependencies...
        Checked 0 service dependencies.
Checking host escalations...
        Checked 0 host escalations.
Checking host dependencies...
        Checked 0 host dependencies.
Checking commands...
        Checked 75 commands.
Checking time periods...
        Checked 8 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
[root@localhost ~]# 
Ditlev - Nagios newbie

Nagios XI, 2011R1.6, 32bit

Operating system
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
CentOS release 5.6 (Final)
Locked