Nagios Web Errors

Hello all,
I am new to nagios and have ran into a wall that I can’t seem to get over. I have read through the docs and am sure that I’m just missing something that I’m hoping you could pin point. Anyway, here is my setup. I’m running Apache 2 and Nagios 2.0b3 on a RHEL 4 machine.

I’m able to get the Nagios web interface to show up and I’ve configured some hosts and services to be monitored. Basically just set up some machines to be pinged to test their connectivity.

I’ve ran the nagios pre-flight check and everything checks out fine without errors. It tells me that I am monitoring 11 hosts and 15 services without error.

I verify that I can run the plugin scripts from the command line against the machines I’m set to monitor. I run the “check_ping” against the machines that I have defined in the hosts.cfg file and it’s working fine from the command line.

However, when I click on anything under “Monitoring” in the left hand pane under my Nagios web interface, I get a message that the status is DOWN and the status information is “no output”. And I also get a 127 out of bounds error telling me that the plugin is missing.

So I went to the docs and this is what I found about that. . .
“The path to the plugin is invalid (i.e. the binary or script does not exist). This is most likely the case if you get errors about a return code of 127 being out of bounds. If this is the error you’re getting, check your command definitions and make sure the path to all executables is correct (and that they’re actually installed on your system).”

OK, but the plugin does exist because I can run it from the command line and it works fine. And I’ve verified the command definitions to make sure they are correct as well. So, that leads me to another FAQ in the Nagios docs . . . regarding Hosts being incorrectly listed as being Down or Unreachable.

That read as follows:
“This seems to be one of the most common problems for new user of Nagios. Most all of the time this problem is due to an incorrect command definition for the host check command you specified in the host definition.”

          AND

“Make sure that the host check command in your host definition is configured correctly. The host check command is not a service - it is part of the host definition. Also, the host check command is not executed at regular intervals like a service is. Rather, it is executed only when Nagios finds it necessary to check the status of the host.”

OK, I’ve verified that the host definition was configured correctly with the check command that I am using for my command line check. Again, it’s working from the command line, the hosts.cfg file points to that check command, and therefore I’m at a loss as to why it’s not showing the correct status output from the web interface and also why am I getting a error out of bounds telling me the plugin is missing when I know the plugin (script) works fine.

Anyway, sorry about the long post, just thought it would be best that you have as much info as possible in troubleshooting. I greatly appreciate your assistance in this matter even if it’s just pointing me back to a certain section of docs. Thanks in advance. :slight_smile:

What I would do is take a step back… Comment out one host at a time or better still just start with one host and a few services.

It will be easier to find the problem that way !!!
It could just be some syntax error that works on the command line.

Thanks for the reply. Always a good idea to take a step backward and look around. I’ve done what you suggested, only monitoring the localhost and one other machine. Both machines are simply being tested for connectivity, with the “check_ping” plugin. Still getting the same errors from the web interface. . . status code of “Return code of 127 is out of bounds - plugin may be missing”.

And the Host Detail status information reads “No Output”.

Again, thanks for the reply, if you can think of anything that I may be doing wrong, please advise.

A side note, in my nagios.cfg file, the only line that’s not commented out under the Object Config File section is:

cfg_file=/usr/local/nagios/etc/minimal.cfg

Here is that section of nagios.cfg:

OBJECT CONFIGURATION FILE(S)

This is the configuration file in which you define hosts, host

groups, contacts, contact groups, services, etc. I guess it would

be better called an object definition file, but for historical

reasons it isn’t. You can split object definitions into several

different config files by using multiple cfg_file statements here.

Nagios will read and process all the config files you define.

This can be very useful if you want to keep command definitions

separate from host and contact definitions…

Plugin commands (service and host check commands)

Arguments are likely to change between different releases of the

plugins, so you should use the same config file provided with the

plugin release rather than the one provided with Nagios.

#cfg_file=/usr/local/nagios/etc/checkcommands.cfg

Misc commands (notification and event handler commands, etc)

#cfg_file=/usr/local/nagios/etc/misccommands.cfg

You can split other types of object definitions across several

config files if you wish (as done here), or keep them all in a

single config file.

cfg_file=/usr/local/nagios/etc/minimal.cfg

#cfg_file=/usr/local/nagios/etc/contactgroups.cfg
#cfg_file=/usr/local/nagios/etc/contacts.cfg
#cfg_file=/usr/local/nagios/etc/dependencies.cfg
#cfg_file=/usr/local/nagios/etc/escalations.cfg
#cfg_file=/usr/local/nagios/etc/hostgroups.cfg
#cfg_file=/usr/local/nagios/etc/hosts.cfg
#cfg_file=/usr/local/nagios/etc/services.cfg
#cfg_file=/usr/local/nagios/etc/timeperiods.cfg

Extended host/service info definitions are now stored along with

other object definitions:

#cfg_file=/usr/local/nagios/etc/hostextinfo.cfg
#cfg_file=/usr/local/nagios/etc/serviceextinfo.cfg

When I uncomment any other line, I get an error in the pre-flight check.

Could this be my problem and if so what needs to be done ?

Thanks in advance. :slight_smile:

if you don’t have the cfg files you shouldn’t uncomment the lines in nagios.cfg :slight_smile:
is the check_ping plugin in /usr/local/nagios/libexec ?
What is the $USER1$ variable set to (not sure i think it’s in the cgi.cfg)

Luca

Luca,
Thanks for the response. I currently only have the minimal.cfg file uncommented. As far as your other questions… my check_ping plugin is in /usr/lib/nagios/plugins directory and the $USER1$ variable is set to the same directory.

Again, if you can think of anywhere else the problem may be, please advise. Thanks again !!!

could you post you minimal.cfg file… OK, I also think that you need to UNCOMMENT the checkcommands line and the misccommands line.

Sure, here is my minimal.cfg file . . .

This defines a timeperiod where all times are valid for checks,

notifications, etc. The classic “24x7” support nightmare. :frowning:

define timeperiod{
timeperiod_name 24x7
alias 24 Hours A Day, 7 Days A Week
sunday 00:00-24:00
monday 00:00-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
}

###############################################################################
###############################################################################

COMMANDS

###############################################################################
###############################################################################

This is a sample service notification command that can be used to send email

notifications (about service alerts) to contacts.

define command{
command_name notify-by-email
command_line /usr/bin/printf “%b” “***** Nagios ***\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddre
ss: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$OUTPUT$" | /bin/mail -s "
$NOTIFICATIONTYPE$ alert - $HOSTALIA
S$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$
}

This is a sample host notification command that can be used to send email

notifications (about host alerts) to contacts.

define command{
command_name host-notify-by-email
command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HO
STADDRESS$\nInfo: $OUTPUT$\n\nDate/Time: $LONGDATETIME$\n” | /bin/mail -s “Host $HOSTSTATE$ alert for $HOSTNAME$!” $CONTACTEMAIL$
}

Command to check to see if a host is “alive” (up) by pinging it

define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 99,99% -c 100,100% -p 1
}

Generic command to check a device by pinging it

define command{
command_name check_ping
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}

Command used to check disk space usage on local partitions

define command{
command_name check_local_disk
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
}

Command used to check the number of currently logged in users on the

local machine

define command{
command_name check_local_users
command_line $USER1$/check_users -w $ARG1$ -c $ARG2$
}

Command to check the number of running processing on the local machine

define command{
command_name check_local_procs
command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$
}

Command to check the load on the local machine

define command{
command_name check_local_load
command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
}

###############################################################################
###############################################################################

CONTACTS

###############################################################################
###############################################################################

In this simple config file, a single contact will receive all alerts.

This assumes that you have an account (or email alias) called

“nagios-admin” on the local host.

define contact{
contact_name nagios-admin
alias Nagios Admin
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email nagios-admin@localhost
}

###############################################################################
###############################################################################

CONTACT GROUPS

###############################################################################
###############################################################################

We only have one contact in this simple configuration file, so there is

no need to create more than one contact group.

define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagios-admin
}

###############################################################################
###############################################################################

HOSTS

###############################################################################
###############################################################################

Generic host definition template - This is NOT a real host, just a template!

define host{
name generic-host ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}

Since this is a simple configuration file, we only monitor one host - the

local host (this machine).

define host{
use check_ping ; Name of host template to use
host_name localhost
alias localhost
address 127.0.0.1
check_command check_ping
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,r
contact_groups admins
}

###############################################################################
###############################################################################

HOST GROUPS

###############################################################################
###############################################################################

We only have one host in our simple config file, so there is no need to

create more than one hostgroup.

define hostgroup{
hostgroup_name test
alias Test Servers
members localhost
}

###############################################################################
###############################################################################

SERVICES

###############################################################################
###############################################################################

Generic service definition template - This is NOT a real service, just a template!

define service{
name generic-service ; The ‘name’ of this service template
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness’
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}

Define a service to “ping” the local machine

define service{
use check_ping ; Name of service template to use
host_name localhost
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_interval 960
notification_period 24x7
check_command check_ping!100.0,20%!500.0,60%
}

Define a service to check the disk space of the root partition

on the local machine. Warning if < 20% free, critical if

< 10% free space on partition.

define service{
use generic-service ; Name of service template to use
host_name localhost
service_description Root Partition
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_interval 960
notification_period 24x7
check_command check_local_disk!20%!10%!/
}

Define a service to check the number of currently logged in

users on the local machine. Warning if > 20 users, critical

if > 50 users.

define service{
use generic-service ; Name of service template to use
host_name localhost
service_description Current Users
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_interval 960
notification_period 24x7
check_command check_local_users!20!50
}

Define a service to check the number of currently running procs

on the local machine. Warning if > 250 processes, critical if

> 400 users.

define service{
use generic-service ; Name of service template to use
host_name localhost
service_description Total Processes
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_interval 960
notification_interval 960
notification_period 24x7
check_command check_local_procs!250!400
}

Define a service to check the load on the local machine.

define service{
use generic-service ; Name of service template to use
host_name localhost
service_description Current Load
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_interval 960
notification_period 24x7
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}

Also, when I uncomment the checkcommands line, I get an error message when I run the nagios check. When I keep it like it is, it checks out just fine.

Thanks again for your assistance. : )

Ummmm… Looks to be OK.
And you are sure that the $USER1$ in your resources.cfg file points to your plugin directory (Mine is libexec by the way !!)

so my resources.cfg looks like so

Sets $USER1$ to be the path to the plugins

$USER1$=/usr/local/nagios/libexec

G

Yeah, I went in there to double check because I initially had to make the change a few weeks ago because it was set to /usr/local/nagios/libexec by default.

Which by the way, I do not have a /usr/local/nagios/libexec directory. My /libexec directory is here. . .

/usr/libexec
/usr/local/libexec

Any other thoughts are greatly appreciated. : )

I’ve yet to see the paste of the nagios config file that says:
resource_file=/usr/local/nagios/etc/resource.cfg

And the paste of the resource.cfg file that says where $USER1$ is located…

Sets $USER1$ to be the path to the plugins

$USER1$=/usr/local/nagios/libexec

AFter you have done that, we need to see the permissions on the $USER1$ directory.

ls -la /usr/local/nagios
ls -la /usr/local/nagios/libexec

Well here is the nagios.cfg file . . . some of it anyway. . .
Below that is the pasted resource.cfg file, and the permissions of the $USER1$ directory . . .

##############################################################################

NAGIOS.CFG - Sample Main Config File for Nagios

Read the documentation for more information on this configuration

file. I’ve provided some comments here, but things may not be so

clear without further explanation.

Last Modified: 03-08-2005

##############################################################################

LOG FILE

This is the main log file where service and host events are logged

for historical purposes. This should be the first option specified

in the config file!!!

log_file=/usr/local/nagios/var/nagios.log

OBJECT CONFIGURATION FILE(S)

This is the configuration file in which you define hosts, host

groups, contacts, contact groups, services, etc. I guess it would

be better called an object definition file, but for historical

reasons it isn’t. You can split object definitions into several

different config files by using multiple cfg_file statements here.

Nagios will read and process all the config files you define.

This can be very useful if you want to keep command definitions

separate from host and contact definitions…

Plugin commands (service and host check commands)

Arguments are likely to change between different releases of the

plugins, so you should use the same config file provided with the

plugin release rather than the one provided with Nagios.

#cfg_file=/usr/local/nagios/etc/checkcommands.cfg

Misc commands (notification and event handler commands, etc)

#cfg_file=/usr/local/nagios/etc/misccommands.cfg

You can split other types of object definitions across several

config files if you wish (as done here), or keep them all in a

single config file.

cfg_file=/usr/local/nagios/etc/minimal.cfg

#cfg_file=/usr/local/nagios/etc/contactgroups.cfg
#cfg_file=/usr/local/nagios/etc/contacts.cfg
#cfg_file=/usr/local/nagios/etc/dependencies.cfg
#cfg_file=/usr/local/nagios/etc/escalations.cfg
#cfg_file=/usr/local/nagios/etc/hostgroups.cfg
#cfg_file=/usr/local/nagios/etc/hosts.cfg
#cfg_file=/usr/local/nagios/etc/services.cfg
#cfg_file=/usr/local/nagios/etc/timeperiods.cfg

Extended host/service info definitions are now stored along with # other object definitions:

#cfg_file=/usr/local/nagios/etc/hostextinfo.cfg
#cfg_file=/usr/local/nagios/etc/serviceextinfo.cfg

You can also tell Nagios to process all config files (with a .cfg

extension) in a particular directory by using the cfg_dir

directive as shown below:

#cfg_dir=/usr/local/nagios/etc/servers
#cfg_dir=/usr/local/nagios/etc/printers
#cfg_dir=/usr/local/nagios/etc/switches
#cfg_dir=/usr/local/nagios/etc/routers

OBJECT CACHE FILE

This option determines where object definitions are cached when

Nagios starts/restarts. The CGIs read object definitions from

this cache file (rather than looking at the object config files

directly) in order to prevent inconsistencies that can occur

when the config files are modified after Nagios starts.

object_cache_file=/usr/local/nagios/var/objects.cache

RESOURCE FILE

This is an optional resource file that contains $USERx$ macro

definitions. Multiple resource files can be specified by using

multiple resource_file definitions. The CGIs will not attempt to

read the contents of resource files, so information that is

considered to be sensitive (usernames, passwords, etc) can be

defined as macros in this file and restrictive permissions (600)

can be placed on this file.

resource_file=/usr/local/nagios/etc/resource.cfg

STATUS FILE

This is where the current status of all monitored services and

hosts is stored. Its contents are read and processed by the CGIs.

The contentsof the status file are deleted every time Nagios

restarts.

status_file=/usr/local/nagios/var/status.dat

NAGIOS USER

This determines the effective user that Nagios should run as.

You can either supply a username or a UID.

nagios_user=nagios

NAGIOS GROUP

This determines the effective group that Nagios should run as.

You can either supply a group name or a GID.

nagios_group=nagios

EXTERNAL COMMAND OPTION

This option allows you to specify whether or not Nagios should check

for external commands (in the command file defined below). By default

Nagios will not check for external commands, just to be on the

cautious side. If you want to be able to use the CGI command interface

you will have to enable this. Setting this value to 0 disables command

checking (the default), other values enable it.

check_external_commands=0

EXTERNAL COMMAND CHECK INTERVAL

This is the interval at which Nagios should check for external commands.

This value works of the interval_length you specify later. If you leave

that at its default value of 60 (seconds), a value of 1 here will cause

Nagios to check for external commands every minute. If you specify a

number followed by an “s” (i.e. 15s), this will be interpreted to mean

actual seconds rather than a multiple of the interval_length variable.

Note: In addition to reading the external command file at regularly

scheduled intervals, Nagios will also check for external commands after

event handlers are executed.

NOTE: Setting this value to -1 causes Nagios to check the external

command file as often as possible.

#command_check_interval=1
#command_check_interval=15s
command_check_interval=-1

EXTERNAL COMMAND FILE

This is the file that Nagios checks for external command requests.

It is also where the command CGI will write commands that are submitted

by users, so it must be writeable by the user that the web server

is running as (usually ‘nobody’). Permissions should be set at the

directory level instead of on the file, as the file is deleted every

time its contents are processed.

command_file=/usr/local/nagios/var/rw/nagios.cmd

COMMENT FILE

This is the file that Nagios will use for storing host and service

comments.

comment_file=/usr/local/nagios/var/comments.dat

DOWNTIME FILE

This is the file that Nagios will use for storing host and service

downtime data.

downtime_file=/usr/local/nagios/var/downtime.dat

LOCK FILE

This is the lockfile that Nagios will use to store its PID number

in when it is running in daemon mode.

lock_file=/usr/local/nagios/var/nagios.lock

TEMP FILE

This is a temporary file that is used as scratch space when Nagios

updates the status log, cleans the comment file, etc. This file

is created, used, and deleted throughout the time that Nagios is

running.

temp_file=/usr/local/nagios/var/nagios.tmp

EVENT BROKER OPTIONS

Controls what (if any) data gets sent to the event broker.

Values: 0 = Broker nothing

-1 = Broker everything

= See documentation

event_broker_options=-1

EVENT BROKER MODULE(S)

This directive is used to specify an event broker module that should

by loaded by Nagios at startup. Use multiple directives if you want

to load more than one module. Arguments that should be passed to

the module at startup are seperated from the module path by a space.

Example:

nebmodule= [moduleargs]

#broker_module=/somewhere/module1.o
#broker_module=/somewhere/module2.o arg1 arg2=3 debug=0

LOG ROTATION METHOD

This is the log rotation method that Nagios should use to rotate

the main log file. Values are as follows…

:

n = None - don’t rotate the log

h = Hourly rotation (top of the hour)

d = Daily rotation (midnight every day)

w = Weekly rotation (midnight on Saturday evening)

m = Monthly rotation (midnight last day of month)

log_rotation_method=d

LOG ARCHIVE PATH

This is the directory where archived (rotated) log files should be

placed (assuming you’ve chosen to do log rotation).

log_archive_path=/usr/local/nagios/var/archives

LOGGING OPTIONS

If you want messages logged to the syslog facility, as well as the

NetAlarm log file set this option to 1. If not, set it to 0.

use_syslog=1

NOTIFICATION LOGGING OPTION

If you don’t want notifications to be logged, set this value to 0.

If notifications should be logged, set the value to 1.

log_notifications=1

SERVICE RETRY LOGGING OPTION

If you don’t want service check retries to be logged, set this value

to 0. If retries should be logged, set the value to 1.

log_service_retries=1

HOST RETRY LOGGING OPTION

If you don’t want host check retries to be logged, set this value to

0. If retries should be logged, set the value to 1.

log_host_retries=1

EVENT HANDLER LOGGING OPTION

If you don’t want host and service event handlers to be logged, set

this value to 0. If event handlers should be logged, set the value

to 1.

log_event_handlers=1

###############################

###########################################################################

RESOURCE.CFG - Sample Resource File for Nagios

Last Modified: 09-10-2003

You can define $USERx$ macros in this file, which can in turn be used

in command definitions in your host config file(s). $USERx$ macros are

useful for storing sensitive information such as usernames, passwords,

etc. They are also handy for specifying the path to plugins and

event handlers - if you decide to move the plugins or event handlers to

a different directory in the future, you can just update one or two

$USERx$ macros, instead of modifying a lot of command definitions.

The CGIs will not attempt to read the contents of resource files, so

you can set restrictive permissions (600 or 660) on them.

Nagios supports up to 32 $USERx$ macros ($USER1$ through $USER32$)

Resource files may also be used to store configuration directives for

external data sources like MySQL…

###########################################################################

Sets $USER1$ to be the path to the plugins

$USER1$=/usr/lib/nagios/plugins

Sets $USER2$ to be the path to event handlers

#$USER2$=/usr/local/nagios/libexec/eventhandlers

Store some usernames and passwords (hidden from the CGIs)

#$USER3$=someuser
#$USER4$=somepassword
###############################

PERMISSIONS OF /usr/local/nagios
drwxr-xr-x 7 nagios nagios 4096 Jun 9 00:06 .
drwxr-xr-x 12 root root 4096 Jun 26 21:56 …
drwxrwxr-x 2 nagios nagios 4096 Jun 7 00:06 bin
drwxrwxr-x 2 nagios nagios 4096 Aug 2 03:56 etc
-rw-r–r-- 1 root root 21 Jun 7 23:51 htpasswd.users
drwxrwxr-x 2 nagios nagios 4096 Jul 5 22:42 sbin
drwxrwxr-x 8 nagios nagios 4096 Jun 21 04:28 share
drwxrwxr-x 4 nagios nagios 4096 Aug 3 04:52 var

PERMISSIONS of /usr/lib/nagios/plugins which is the $USER1$ directory . . .

-rwxr-xr-x 1 root root 2262 Mar 5 00:39 check_breeze
-rwxr-xr-x 1 root root 31916 Mar 5 00:39 check_by_ssh
-rwxr-xr-x 1 root root 13139 Mar 5 00:39 check_cluster
-rwxr-xr-x 1 root root 10296 Mar 5 00:39 check_cluster2
-rwxr-xr-x 1 root root 29875 Mar 5 00:39 check_dhcp
-rwxr-xr-x 1 root root 29761 Mar 5 00:39 check_dig
-rwxr-xr-x 1 root root 34539 Mar 5 00:39 check_disk
-rwxr-xr-x 1 root root 8037 Mar 5 00:39 check_disk_smb
-rwxr-xr-x 1 root root 32574 Mar 5 00:39 check_dns
-rwxr-xr-x 1 root root 14913 Mar 5 00:39 check_dummy
-rwxr-xr-x 1 root root 3083 Mar 5 00:39 check_file_age
-rwxr-xr-x 1 root root 6388 Mar 5 00:39 check_flexlm
lrwxrwxrwx 1 root root 9 Jul 20 02:12 check_ftp -> check_tcp
-rwxr-xr-x 1 root root 24488 Mar 5 00:39 check_game
-rwxr-xr-x 1 root root 28660 Mar 5 00:39 check_hpjd
-rwxr-xr-x 1 root root 55537 Mar 5 00:39 check_http
-rwxr-xr-x 1 root root 24263 Mar 5 00:39 check_icmp
-rwxr-xr-x 1 root root 15280 Mar 5 00:39 check_ifoperstatus
-rwxr-xr-x 1 root root 12846 Mar 5 00:39 check_ifstatus
lrwxrwxrwx 1 root root 9 Jul 20 02:12 check_imap -> check_tcp
-rwxr-xr-x 1 root root 7425 Mar 5 00:39 check_ircd
lrwxrwxrwx 1 root root 9 Jul 20 02:12 check_jabber -> check_tcp
-rwxr-xr-x 1 root root 25483 Mar 5 00:39 check_ldap
lrwxrwxrwx 1 root root 10 Jul 20 02:12 check_ldaps -> check_ldap
-rwxr-xr-x 1 root root 23945 Mar 5 00:39 check_load
-rwxr-xr-x 1 root root 5943 Mar 5 00:39 check_log
-rwxr-xr-x 1 root root 20738 Mar 5 00:39 check_mailq
-rwxr-xr-x 1 root root 20904 Mar 5 00:39 check_mrtg
-rwxr-xr-x 1 root root 19986 Mar 5 00:39 check_mrtgtraf
-rwxr-xr-x 1 root root 24228 Mar 5 00:39 check_mysql
-rwxr-xr-x 1 root root 23752 Mar 5 00:39 check_nagios
lrwxrwxrwx 1 root root 9 Jul 20 02:12 check_nntp -> check_tcp
lrwxrwxrwx 1 root root 9 Jul 20 02:12 check_nntps -> check_tcp
-rwxr-xr-x 1 root root 32009 Mar 5 00:39 check_nt
-rwxr-xr-x 1 root root 13271 Mar 5 00:39 check_ntp
-rwxr-xr-x 1 root root 35811 Mar 5 00:39 check_nwstat
-rwxr-xr-x 1 root root 8293 Mar 5 00:39 check_oracle
-rwxr-xr-x 1 root root 27419 Mar 5 00:39 check_overcr
-rwxr-xr-x 1 root root 25662 Mar 5 00:39 check_pgsql
-rwxr-xr-x 1 root root 34077 Mar 5 00:39 check_ping
lrwxrwxrwx 1 root root 9 Jul 20 02:12 check_pop -> check_tcp
-rwxr-xr-x 1 root root 33706 Mar 5 00:39 check_procs
-rwxr-xr-x 1 root root 22610 Mar 5 00:39 check_radius
-rwxr-xr-x 1 root root 26089 Mar 5 00:39 check_real
-rwxr-xr-x 1 root root 9700 Mar 5 00:39 check_rpc
-rwxr-xr-x 1 root root 1176 Mar 5 00:39 check_sensors
lrwxrwxrwx 1 root root 9 Jul 20 02:12 check_simap -> check_tcp
-rwxr-xr-x 1 root root 36500 Mar 5 00:39 check_smtp
-rwxr-xr-x 1 root root 41435 Mar 5 00:39 check_snmp
lrwxrwxrwx 1 root root 9 Jul 20 02:12 check_spop -> check_tcp
-rwxr-xr-x 1 root root 22768 Mar 5 00:39 check_ssh
-rwxr-xr-x 1 root root 25003 Mar 5 00:39 check_swap
-rwxr-xr-x 1 root root 36500 Mar 5 00:39 check_tcp
-rwxr-xr-x 1 root root 24858 Mar 5 00:39 check_time
-rwxr-xr-x 1 root root 7336 Mar 5 00:39 check_timeout
-rwxr-xr-x 1 root root 23582 Mar 5 00:39 check_udp
lrwxrwxrwx 1 root root 9 Jul 20 02:12 check_udp2 -> check_tcp
-rwxr-xr-x 1 root root 31014 Mar 5 00:39 check_ups
-rwxr-xr-x 1 root root 21951 Mar 5 00:39 check_users
-rwxr-xr-x 1 root root 3012 Mar 5 00:39 check_wave
drwxr-xr-x 2 root root 4096 Jul 20 02:12 contrib
-rwxr-xr-x 1 root root 22100 Mar 5 00:39 negate
-rwxr-xr-x 1 root root 21515 Mar 5 00:39 urlize
-rwxr-xr-x 1 root root 2469 Mar 5 00:39 utils.pm
-rwxr-xr-x 1 root root 868 Mar 5 00:39 utils.sh

Well, again, I greatly appreciate any help that you can provide. 8 )

should be nagios.nagios for permissions on the check_plugins directory. and 755.
-rwxr-xr-x 1 nagios nagios 40609 Jun 25 16:23 check_radius

OK, I’ve chowned and chgrped the /usr/lib/nagios/plugins directory which is my check_plugins directory to be nagios.nagios. And, I’ve changed the ownership and the group of those scripts to nagios.nagios. . . Restarted apache and nagios, still getting the same error messages of “127 out of bounds, plugins may be missing” and “no output” . . .

I’ve got to be missing something . . . : /

seems i’m missing something… as root user su to nagios user and try executing some plugins… ./check_ping and so on…

Luca

Luca,
I logged in as root, su over to nagios user and then checked to see if I could execute some of the plugins and was able to just fine.

Also, when I log into the web interface, I do so with my user account and the user of which I’ve set up authentication for against the server and for the CGI’s. So, I also sued over to my username, the one I log into with on the web side, and tried to execute plugins, I could as that user as well.

Just wanted to add that in case logging into the web side of things with a user other than nagios would cause a problem.

the web authentication and the OS authentication are spearate things. so the nagios user in the web interface is NOT the same nagios user on the system (if you did the auth by the books using htpasswd) :slight_smile:

If you can execute the plugins as the nagios user it looks like it doesn’t find the plugins somehow… can you try to check the system and nagios logs looking for a more specific error?

Luca

ok Luca, I’ve looked at the nagios logs for a specific error. This is what the nagios logs are telling me . . .

Warning: Return code of 127 for check of service ‘PING’ on host ‘machine.hostname.net’ was out of bounds. Make sure the plugin you’re trying to run actually exists.

Warning: Return code of 127 for check of service ‘Total Processes’ on host ‘localhost’ was out of bounds.
Make sure the plugin you’re trying to run actually exists.

Warning: Return code of 127 for check of service ‘Current Load’ on host ‘localhost’ was out of bounds. Make sure the plugin you’re trying to run actually exists.

HOST NOTIFICATION: nagios-admin;blinky.myactv.net;DOWN;host-notify-by-email;(No output!)

Those error messages are almost identical to the ones that I see on the web interface. And as we know, those plugins do work unless there is a misconfiguration with how they are to actually “check” the machines. I don’t know. . . :frowning:

it looks like there’s some sort of mismatch between the directories where the plugins are and where nagios looks for them…

you could try putting one of the plugins (check_ping) in the nagios/libexec folder just to see what happens… or check the config files again… possibly some / missing…

Luca

I think your right Luca, there is something wrong with where my plugins are located, and where nagios looks for them. . .

However, I don’t have a nagios/libexec directory. The only libexec directories on my box are;

/usr/libexec
/usr/local/libexec

And currently, my resource.cfg file is pointing to:

/usr/lib/nagios/plugins

which is where my plugins are located on the machine.

But, I did have to change that resourse.cfg file because it initially had the directory of :
/usr/local/nagios/libexec, which is the directory that doesn’t exist on my machine. . .

Change check_host_alive in minimal.cfg to this… it is what i use and never changed from original…

And before anyone says… but that is what mine is and it is from original… I know, it is defined in 2 (YES TWO ) places… and it is worth a try…

This command checks to see if a host is “alive” by pinging it

The check must result in a 100% packet loss or 5 second (5000ms) round trip

average time to produce a critical error.

Note: Only one ICMP echo packet is sent (determined by the ‘-p 1’ argument)

‘check-host-alive’ command definition

define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1