Page 3 of 3
Re: Problem with Auto-Discovery
Posted: Thu Aug 04, 2011 8:48 am
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.
Re: Problem with Auto-Discovery
Posted: Fri Aug 05, 2011 7:10 am
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)
Re: Problem with Auto-Discovery
Posted: Fri Aug 05, 2011 10:03 am
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.
Re: Problem with Auto-Discovery
Posted: Mon Aug 08, 2011 12:50 am
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 ~]#