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 »

ditlevw wrote:
nscott wrote:I'm currently doing some testing on this component/wizard. There was a bug in this component/wizard several weeks ago. There is phantom bug where the wheel will keep spinning and all you'll need to do is hit the refresh job list.

If you have some sort of IDS and packet sniffer that could be in issue as well, since fping and then the corresponding port check would definitely raise some IDS alarms.
I don't have any IDS ...yet.
Uh!

I just found another thread with a solution for my hosts that does'nt disapear when I remove them from CCM.

Thread: http://support.nagios.com/forum/viewtop ... osts#p9178
Solution: http://support.nagios.com/wiki/index.ph ... t_Hosts.29

I still got the initial problem with Auto Discovery though.
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 »

ditlevw wrote:
ditlevw wrote:
nscott wrote:I'm currently doing some testing on this component/wizard. There was a bug in this component/wizard several weeks ago. There is phantom bug where the wheel will keep spinning and all you'll need to do is hit the refresh job list.

If you have some sort of IDS and packet sniffer that could be in issue as well, since fping and then the corresponding port check would definitely raise some IDS alarms.
I don't have any IDS ...yet.
Uh!

I just found another thread with a solution for my hosts that does'nt disapear when I remove them from CCM.

Thread: http://support.nagios.com/forum/viewtop ... osts#p9178
Solution: http://support.nagios.com/wiki/index.ph ... t_Hosts.29

I still got the initial problem with Auto Discovery though.
Aargh.

I just thought that things would start working after I found out how to delete hosts. Now my hosts (except localhost) have been deleted, but I can't add a new host!!! I run through the monitoring wizard and find my hosts, in this case network devices. It finds my hosts and I choose to add them, but they don't appear. Neither in CCM, "Host Detail" nor in "/usr/local/nagios/etc/hosts".

Why? :(
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
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Problem with Auto-Discovery

Post by lmiltchev »

If the configuration applies but not changes take place, this is an indication of a permissions issue. Refer to our documentation on the topic:

http://support.nagios.com/wiki/index.ph ... Take_Place
Be sure to check out our Knowledgebase for helpful articles and solutions!
ditlevw
Posts: 29
Joined: Fri Apr 01, 2011 3:25 am

Re: Problem with Auto-Discovery

Post by ditlevw »

lmiltchev wrote:If the configuration applies but not changes take place, this is an indication of a permissions issue. Refer to our documentation on the topic:

http://support.nagios.com/wiki/index.ph ... Take_Place
Thanks, ...but it didn't help.

I checked the config in CCM and it returned with no errors (Things look okay - No serious problems were detected during the pre-flight check ). I restarted Nagios (from CCM) ...or at least I tried and it returned with this error: Restart failed - Nagios command file not found or no execute permissions. Then I executed the "reset_config_perms"-script in "/usr/local/nagiosxi/scripts" (not in "/usr/local/nagiosxi" as it says in the documentation). The script returned with:

Code: Select all

 ./reset_config_perms
SETUID ROOT OK
RESETTING PERMS
After that, I ran the test and tried to restart Nagios from CCM ...but with no success. I extended the test to try to add a host but now it seems even worse. When it gives me the option to assign it to hostgroups and servicegroups ...it doesn't show the groups. It's like if there aren't any. What the :evil: (sorry :roll: ) happened? Clicking "next" submits the configuration for processing then it runs the "Waiting for configuration verification......................................" for ages.

Well, then I did a:

Code: Select all

killall nagios
service nagios start
After that I accessed the Nagios Home and it returned with a permission error. It also told me what to do to resolve it. I ran the following commands:

Code: Select all

 chown root.nagios /usr/local/nagiosxi/scripts/reset_config_perms
 chmod u+s /usr/local/nagiosxi/scripts/reset_config_perms
 chown root.nagios /usr/local/nagiosxi/scripts/reset_config_perms.sh
 chmod u+s /usr/local/nagiosxi/scripts/reset_config_perms.sh
Then I tried to add a host again ...but same result as before. :( Killed the service and started Nagios again.

It's getting harder and harder for me to prepare a (working) demonstration of this product to my servicegroup. I have to find a product for monitoring more than 400 network devices and I'm running out of time. :|
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 »

Alright, we just developed a fix permissions script for this very case. Give this a shot. You'll need to download it to your linux server, chmod +x it and then execute it. You must be root when running it.
You do not have the required permissions to view the files attached to this post.
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:Alright, we just developed a fix permissions script for this very case. Give this a shot. You'll need to download it to your linux server, chmod +x it and then execute it. You must be root when running it.
Hmm, ...Not sure if I've done it right, but take a look at this output:

Code: Select all

[root@localhost tmp]# sh 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/var/ndomod.tmp': No such file or directory
chown: cannot access `/usr/local/nagios/var/ndomod.tmp': No such file or directory

[root@localhost tmp]# ls /usr/local/nagios/libexec/
check_apt                 check_flexlm            check_ldap                    check_nt           check_rrdtraf                check_snmp_load.pl     check_users
check_breeze              check_fping             check_ldaps                   check_ntp          check_rrdtraf.php            check_snmp_mem.pl      check_wave
check_by_ssh              check_ftp               check_load                    check_ntp_peer     check_sensors                check_snmp_nsbox.pl    check_webinject.sh
check_clamd               check_ftp_fully         check_log                     check_ntp_time     check_simap                  check_snmp_process.pl  negate
check_cluster             check_hpjd              check_mailq                   check_nwstat       check_smtp                   check_snmp_storage.pl  process_perfdata.pl
check_dhcp                check_http              check_mrtg                    check_oracle       check_smtp_send              check_snmp_vrrp.pl     send_nsca
check_dig                 check_icmp              check_mrtgtraf                check_overcr       check_smtp_send_epn          check_snmp_win.pl      urlize
check_disk                check_ide_smart         check_mysql                   check_pgsql        check_snmp                   check_spop             utils.pm
check_disk_smb            check_ifoperstatus      check_mysql_query             check_ping         check_snmp_boostedge.pl      check_ssh              utils.sh
check_dns                 check_ifstatus          check_nagios                  check_pnp_rrds.pl  check_snmp_cpfw.pl           check_ssmtp
check_dummy               check_imap              check_nagios_performance.php  check_pop          check_snmp_css_main.pl       check_swap
check_email_delivery      check_imap_receive      check_nagiosxiserver.php      check_procs        check_snmp_css.pl            check_tcp
check_email_delivery_epn  check_imap_receive_epn  check_nntp                    check_radius_adv   check_snmp_env.pl            check_time
check_email_loop.pl       check_ircd              check_nntps                   check_real         check_snmp_int.pl            check_udp
check_file_age            check_jabber            check_nrpe                    check_rpc          check_snmp_linkproof_nhr.pl  check_ups
[root@localhost tmp]# ls -l /usr/local/nagios/libexec/
total 4584
-rwxr-xr-x 1 root   root    72834 Jan 11  2010 check_apt
-rwxr-xr-x 1 root   root     2274 Jan 11  2010 check_breeze
-rwxr-xr-x 1 root   root    84849 Jan 11  2010 check_by_ssh
lrwxrwxrwx 1 apache nagios      9 Jan 11  2010 check_clamd -> check_tcp
-rwxr-xr-x 1 root   root    49182 Jan 11  2010 check_cluster
-r-xr-xr-x 1 root   root    80778 Jan 11  2010 check_dhcp
-rwxr-xr-x 1 root   root    80249 Jan 11  2010 check_dig
-rwxr-xr-x 1 root   root   117609 Jan 11  2010 check_disk
-rwxr-xr-x 1 root   root     8163 Jan 11  2010 check_disk_smb
-rwxr-xr-x 1 root   root    86298 Jan 11  2010 check_dns
-rwxr-xr-x 1 root   root    44899 Jan 11  2010 check_dummy
-rwxr-xr-x 1 apache nagios  38345 Aug 18  2010 check_email_delivery
-rwxr-xr-x 1 apache nagios  20511 Aug 18  2010 check_email_delivery_epn
-rwxr-xr-x 1 root   root    13498 Jan 11  2010 check_email_loop.pl
-rwxr-xr-x 1 root   root     3143 Jan 11  2010 check_file_age
-rwxr-xr-x 1 root   root     6395 Jan 11  2010 check_flexlm
-rwxr-xr-x 1 root   root    93728 Jan 11  2010 check_fping
lrwxrwxrwx 1 apache nagios      9 Jan 11  2010 check_ftp -> check_tcp
-rwxr-xr-x 1 apache nagios   3437 Aug 18  2010 check_ftp_fully
-rwxr-xr-x 1 root   root    88562 Jan 11  2010 check_hpjd
-rwxr-xr-x 1 root   root   189782 Jan 11  2010 check_http
-r-xr-xr-x 1 root   root    87130 Jan 11  2010 check_icmp
-rwxr-xr-x 1 root   root    55561 Jan 11  2010 check_ide_smart
-rwxr-xr-x 1 root   root    15310 Jan 11  2010 check_ifoperstatus
-rwxr-xr-x 1 root   root    12853 Jan 11  2010 check_ifstatus
lrwxrwxrwx 1 apache nagios      9 Jan 11  2010 check_imap -> check_tcp
-rwxr-xr-x 1 apache nagios  35413 Aug 18  2010 check_imap_receive
-rwxr-xr-x 1 apache nagios  15576 Aug 18  2010 check_imap_receive_epn
-rwxr-xr-x 1 root   root     7429 Jan 11  2010 check_ircd
lrwxrwxrwx 1 apache nagios      9 Jan 11  2010 check_jabber -> check_tcp
-rwxrwxrwx 1 root   root    66203 Jan 11  2010 check_ldap
lrwxrwxrwx 1 apache nagios     10 Jan 11  2010 check_ldaps -> check_ldap
-rwxr-xr-x 1 root   root    73244 Jan 11  2010 check_load
-rwxr-xr-x 1 root   root     6062 Jan 11  2010 check_log
-rwxr-xr-x 1 root   root    20367 Jan 11  2010 check_mailq
-rwxr-xr-x 1 root   root    55634 Jan 11  2010 check_mrtg
-rwxr-xr-x 1 root   root    54533 Jan 11  2010 check_mrtgtraf
-rwxr-xr-x 1 root   root    81798 Jan 11  2010 check_mysql
-rwxr-xr-x 1 root   root    77794 Jan 11  2010 check_mysql_query
-rwxr-xr-x 1 root   root    68126 Jan 11  2010 check_nagios
-rwxr-xr-x 1 apache nagios   6367 Feb 28 20:58 check_nagios_performance.php
-rwxr-xr-x 1 apache nagios  17203 Aug 18  2010 check_nagiosxiserver.php
lrwxrwxrwx 1 apache nagios      9 Jan 11  2010 check_nntp -> check_tcp
lrwxrwxrwx 1 apache nagios      9 Jan 11  2010 check_nntps -> check_tcp
-rwxrwxr-x 1 nagios nagios  58037 Jan 11  2010 check_nrpe
-rwxr-xr-x 1 root   root    79879 Jan 11  2010 check_nt
-rwxr-xr-x 1 root   root    81738 Jan 11  2010 check_ntp
-rwxr-xr-x 1 root   root    76148 Jan 11  2010 check_ntp_peer
-rwxr-xr-x 1 root   root    72770 Jan 11  2010 check_ntp_time
-rwxr-xr-x 1 root   root   105493 Jan 11  2010 check_nwstat
-rwxr-xr-x 1 root   root     8366 Jan 11  2010 check_oracle
-rwxr-xr-x 1 root   root    68257 Jan 11  2010 check_overcr
-rwxr-xr-x 1 root   root    64203 Jan 11  2010 check_pgsql
-rwxr-xr-x 1 root   root    97396 Jan 11  2010 check_ping
-rwxr-xr-x 1 nagios nagios   6183 Jun 27 06:20 check_pnp_rrds.pl
lrwxrwxrwx 1 apache nagios      9 Jan 11  2010 check_pop -> check_tcp
-rwxr-xr-x 1 root   root    88689 Jan 11  2010 check_procs
-rwxr-xr-x 1 apache nagios  23327 Aug 18  2010 check_radius_adv
-rwxr-xr-x 1 root   root    65607 Jan 11  2010 check_real
-rwxr-xr-x 1 root   root     9707 Jan 11  2010 check_rpc
-rwxr-xr-x 1 root   root     9232 Jan 11  2010 check_rrdtraf
-rwxr-xr-x 1 root   root     5299 Jan 11  2010 check_rrdtraf.php
-rwxr-xr-x 1 root   root     1176 Jan 11  2010 check_sensors
lrwxrwxrwx 1 apache nagios      9 Jan 11  2010 check_simap -> check_tcp
-rwxr-xr-x 1 root   root   119118 Jan 11  2010 check_smtp
-rwxr-xr-x 1 apache nagios  20226 Aug 18  2010 check_smtp_send
-rwxr-xr-x 1 apache nagios  10440 Aug 18  2010 check_smtp_send_epn
-rwxr-xr-x 1 root   root   144442 Jan 11  2010 check_snmp
-rwxr-xr-x 1 root   root    10951 Jan 11  2010 check_snmp_boostedge.pl
-rwxr-xr-x 1 root   root    17866 Jan 11  2010 check_snmp_cpfw.pl
-rwxr-xr-x 1 root   root     8747 Jan 11  2010 check_snmp_css_main.pl
-rwxr-xr-x 1 root   root    16786 Jan 11  2010 check_snmp_css.pl
-rwxr-xr-x 1 root   root    33562 Jan 11  2010 check_snmp_env.pl
-rwxr-xr-x 1 root   root    31919 Jan 11  2010 check_snmp_int.pl
-rwxr-xr-x 1 root   root    10108 Jan 11  2010 check_snmp_linkproof_nhr.pl
-rwxr-xr-x 1 root   root    22965 Jan 11  2010 check_snmp_load.pl
-rwxr-xr-x 1 root   root    18734 Jan 11  2010 check_snmp_mem.pl
-rwxr-xr-x 1 root   root    11898 Jan 11  2010 check_snmp_nsbox.pl
-rwxr-xr-x 1 root   root    24233 Jan 11  2010 check_snmp_process.pl
-rwxr-xr-x 1 root   root    24002 Jan 11  2010 check_snmp_storage.pl
-rwxr-xr-x 1 root   root    14489 Jan 11  2010 check_snmp_vrrp.pl
-rwxr-xr-x 1 root   root    11967 Jan 11  2010 check_snmp_win.pl
lrwxrwxrwx 1 apache nagios      9 Jan 11  2010 check_spop -> check_tcp
-rwxr-xr-x 1 root   root    64079 Jan 11  2010 check_ssh
lrwxrwxrwx 1 apache nagios      9 Jan 11  2010 check_ssmtp -> check_tcp
-rwxr-xr-x 1 root   root    77492 Jan 11  2010 check_swap
-rwxrwxrwx 1 root   root   105411 Jan 11  2010 check_tcp
-rwxr-xr-x 1 root   root    66786 Jan 11  2010 check_time
lrwxrwxrwx 1 apache nagios      9 Jan 11  2010 check_udp -> check_tcp
-rwxr-xr-x 1 root   root    73841 Jan 11  2010 check_ups
-rwxr-xr-x 1 root   root    72255 Jan 11  2010 check_users
-rwxr-xr-x 1 root   root     3019 Jan 11  2010 check_wave
-rwxr-xr-x 1 root   root      307 Jan 11  2010 check_webinject.sh
-rwxr-xr-x 1 root   root    69425 Jan 11  2010 negate
-rwxr-xr-x 1 nagios nagios  42724 Jun 27 06:20 process_perfdata.pl
-rwxr-xr-x 1 root   root    45258 Jan 11  2010 send_nsca
-rwxr-xr-x 1 root   root    71178 Jan 11  2010 urlize
-rwxr-xr-x 1 root   root     2070 Jan 11  2010 utils.pm
-rwxr-xr-x 1 root   root      862 Jan 11  2010 utils.sh
[root@localhost tmp]# 
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 »

Yeah, its ok if those perfdata files could not be found, and it looks like the plugins directory has the proper permissions. Are you now able to restart nagios?
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:Yeah, its ok if those perfdata files could not be found, and it looks like the plugins directory has the proper permissions. Are you now able to restart nagios?
Sorry. I ran out of patience. I deleted the NagiosXI from my ESX-environment and started all over again. While deleting the server from from the ESX, I discovered that someone had tried to install VMware tools. I must have been a mistake. I'm not sure if it has anything to do with it, but now I've installed NagiosXI again. Here is how I did it:
  • Downloaded the latest NagiosXI release R1.6
  • Changed from trial-licens to FREE-license
Well, thats what I've done. Everything seems to be fine. I must also inform that the NagiosXI is behind a firewall but I all traffic from Nagios and back has been permitted. I can also inform that I have a switch on the same network segment as my NagiosXI and therefore doesn't need to pass through the firewall to access it.

I have tried to do an autodiscovery on both the segment I want to find all my network-devices on and on the same segment as the NagiosXI and the switch. It turns out with no result. Using the Monitoring Wizard finds the devices I want.

Should I try to run your script again? ... Thinking about doing it.
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 »

ditlevw wrote:
nscott wrote:Yeah, its ok if those perfdata files could not be found, and it looks like the plugins directory has the proper permissions. Are you now able to restart nagios?
Sorry. I ran out of patience. I deleted the NagiosXI from my ESX-environment and started all over again. While deleting the server from from the ESX, I discovered that someone had tried to install VMware tools. I must have been a mistake. I'm not sure if it has anything to do with it, but now I've installed NagiosXI again. Here is how I did it:
  • Downloaded the latest NagiosXI release R1.6
  • Changed from trial-licens to FREE-license
Well, thats what I've done. Everything seems to be fine. I must also inform that the NagiosXI is behind a firewall but I all traffic from Nagios and back has been permitted. I can also inform that I have a switch on the same network segment as my NagiosXI and therefore doesn't need to pass through the firewall to access it.

I have tried to do an autodiscovery on both the segment I want to find all my network-devices on and on the same segment as the NagiosXI and the switch. It turns out with no result. Using the Monitoring Wizard finds the devices I want.

Should I try to run your script again? ... Thinking about doing it.
No no no. Not good.

I ran the script and the "XI System Component Status" turns red with the following errors:

Code: Select all

configuration file /usr/local/nagios/etc/nagios.cfg not found. Exiting
and

Code: Select all

configuration file /usr/local/nagios/etc/ndo2db.cfg not found. Exiting
I tried to reboot, but no change. Frustrating. Am I the only one with this problem?
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 »

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?
Nicholas Scott
Former Nagios employee
Locked