Host page status won't update from "Pending"

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Docster
Posts: 4
Joined: Tue Nov 09, 2010 3:46 pm

Host page status won't update from "Pending"

Post by Docster »

I have a new installation of Nagios 3.2.3 with Plug-ins 1.4.15 running on SuSE SLES 11, SP1, 64bit Intel platform, HP DL360 G7.

Nagios appears to be working with a few exceptions. When I click on the "Hosts" link, only two of my hosts show a "Status" of "UP." The rest all show "Pending," and I can't figure out the difference that allows two to show, but not the rest. One of the green "UP" servers is the localhost. However, I have the localhost also listed as a server by hostname and it does not indictate "UP."

These additional issues may be clues or not related:

1) Clicking on the "Trends" link in the menu leads to a "Object Not Found" 404 error.
2) Trying to look at the "Event Log,", "Process Info," or "Scheduling Queue" link leads to an error that says:
"It appears as though you do not have permission to view the log file...
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.
"

3) The "Configuration" menu link works, but when I select the type of data I want to view, I get the same CGI error from #2 above.

Hoping for an idea and thanks in advance,

The Docster
Thanks,

The Docster
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Host page status won't update from "Pending"

Post by mguthrie »

Check to see that your username is added in the nagios/etc/cgi.cfg file. This contains all of the settings for global user permissions. You also might want to make sure apache is pointing to the correct directory for it's cgi-bin files. This is generally listed in a file called nagios.conf in your webserver configuration directory, but it can differ depending on how you installed and what distro you're on.

Also, you probably don't have a check command defined for your new hosts. Look at the host definition for localhost and you'll see there's a check command like "check-host-alive." If nothing like that is defined for a host it will probably be pending indefinitely, even though other services are showing that it's up.
Docster
Posts: 4
Joined: Tue Nov 09, 2010 3:46 pm

Re: Host page status won't update from "Pending"

Post by Docster »

Thanks. Adding the user name to nagios.cfg worked for most of the menu issues.

However, I still can't get the status to update from "Pending" to "UP." The two servers that are showing "UP" are the localhost and another server. All my servers are listed and using the same check_command in the same service in the services.cfg file. I see no reason that one would work and the rest won't.

Thanks again for the help.
Thanks,

The Docster
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Host page status won't update from "Pending"

Post by mguthrie »

Does the actual host definition have a check_command defined in it, either in the host definition or the host template that is used? This is different than a service definition. Even if you have you 50 OK services for a host, it will still show as pending if the host definition doesn't have a check command to see if it's UP. Usually something like check-host-alive is used.
Docster
Posts: 4
Joined: Tue Nov 09, 2010 3:46 pm

Re: Host page status won't update from "Pending"

Post by Docster »

The localhost.cfg also contains services for the localhost. Here are the services in localhost.cfg:

define service{
use local-service ; Name of service template to use
host_name localhost
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Root Partition
check_command check_local_disk!20%!10%!/
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Current Users
check_command check_local_users!20!50
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Total Processes
check_command check_local_procs!250!400!RSZDT
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Current Load
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Swap Usage
check_command check_local_swap!20!10
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description SSH
check_command check_ssh
notifications_enabled 0
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description HTTP
check_command check_http
notifications_enabled 0
}

As you can see, there is no reference to "check-host-alive," but it does do a ping. All my other servers are using the services.cfg file. I also have the localhost server listed with the rest of the servers by it's hostname. The localhost entry shows "UP" and the hostname entry shows "Pending." One of the other servers also shows "UP," but it's using the same services as all the other servers I have.

Would you like to see any of my config files?
Thanks,

The Docster
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Host page status won't update from "Pending"

Post by mguthrie »

Try something like this:

Note the check command on the host definition.

Code: Select all

define host {
        host_name                   Ubuntu Workstation
        use                             whatever_template
        address                         192.168.x.x
        check_command             check-host-alive
        register                        1
        }
Docster
Posts: 4
Joined: Tue Nov 09, 2010 3:46 pm

Re: Host page status won't update from "Pending"

Post by Docster »

I LOVE YOU! It worked!

Adding the "check_command check-host-alive" to the hosts.cfg did the trick. I'm so pleased. Thank you muchly. :D
Thanks,

The Docster
Locked