<br>
<br><font size=2><tt><br>
<br>
> Service definitions for nagios to check.</tt></font>
<br>
<br><font size=2><tt>Yup I realized that. I think there was a similar thread
on the archives where someone mentioned that Nagios doesn't check host
without services. So I defined 5 services on the localhost. But it was
always in Pending state. Also there was another suggestion to go ahead
and disable all service checks and then reenable them through the interface.
That didn't work either.<br>
<br>
<br>
> Are the services on your other<br>
> host being checked? If no, please post the host, service and command<br>
> definitions in question as well as nagios version and plugins version.<br>
</tt></font>
<br><font size=2><tt>Nope, as I said earlier, services on itself were not
being checked. Here are the details (all of them are modified version of
sample configs that come with fresh install of Nagios v2.0b3 and Nagios-plugin
v1.4 on Redhat 7.3):</tt></font>
<br>
<br><font size=2><tt>Host:</tt></font>
<br><font size=2><tt><br>
define host{</tt></font>
<br><font size=2><tt> use
generic-host
; Name of host template to use</tt></font>
<br><font size=2><tt> host_name
localhost</tt></font>
<br><font size=2><tt> alias
moya</tt></font>
<br><font size=2><tt> address
127.0.0.1</tt></font>
<br><font size=2><tt> check_command
check-host-alive</tt></font>
<br><font size=2><tt> max_check_attempts
10</tt></font>
<br><font size=2><tt> notification_interval
120</tt></font>
<br><font size=2><tt> notification_period
24x7</tt></font>
<br><font size=2><tt> notification_options
d,r</tt></font>
<br><font size=2><tt> contact_groups admins</tt></font>
<br><font size=2><tt> }<br>
</tt></font>
<br>
<br><font size=2><tt>SERVICES:</tt></font>
<br><font size=2 face="sans-serif">define service{</font>
<br><font size=2 face="sans-serif"> use
generic-service ; Name of service
template to use</font>
<br><font size=2 face="sans-serif"> host_name
localhost</font>
<br><font size=2 face="sans-serif"> service_description
Root Partition</font>
<br><font size=2 face="sans-serif"> is_volatile
0</font>
<br><font size=2 face="sans-serif"> check_period
24x7</font>
<br><font size=2 face="sans-serif"> max_check_attempts
4</font>
<br><font size=2 face="sans-serif"> normal_check_interval
5</font>
<br><font size=2 face="sans-serif"> retry_check_interval
1</font>
<br><font size=2 face="sans-serif"> contact_groups
admins</font>
<br><font size=2 face="sans-serif"> notification_interval
960</font>
<br><font size=2 face="sans-serif"> notification_period
24x7</font>
<br><font size=2 face="sans-serif"> check_command
check_local_disk!20%!10%!/</font>
<br><font size=2 face="sans-serif"> }</font>
<br><font size=2 face="sans-serif"># Define a service to check the load
on the local machine.</font>
<br>
<br><font size=2 face="sans-serif">define service{</font>
<br><font size=2 face="sans-serif"> use
generic-service ; Name of service
template to use</font>
<br><font size=2 face="sans-serif"> host_name
localhost</font>
<br><font size=2 face="sans-serif"> service_description
Current Load</font>
<br><font size=2 face="sans-serif"> is_volatile
0</font>
<br><font size=2 face="sans-serif"> check_period
24x7</font>
<br><font size=2 face="sans-serif"> max_check_attempts
4</font>
<br><font size=2 face="sans-serif"> normal_check_interval
5</font>
<br><font size=2 face="sans-serif"> retry_check_interval
1</font>
<br><font size=2 face="sans-serif"> contact_groups
admins</font>
<br><font size=2 face="sans-serif"> notification_interval
960</font>
<br><font size=2 face="sans-serif"> notification_period
24x7</font>
<br><font size=2 face="sans-serif"> check_command
check_local_load!5.0,4.0,3.0!10.0,6.0,4.0</font>
<br><font size=2 face="sans-serif"> }</font>
<br><font size=2 face="sans-serif"># Define a service to check the number
of currently running procs</font>
<br><font size=2 face="sans-serif"># on the local machine. Warning
if > 250 processes, critical if</font>
<br><font size=2 face="sans-serif"># > 400 users.</font>
<br>
<br><font size=2 face="sans-serif">define service{</font>
<br><font size=2 face="sans-serif"> use
generic-service ; Name of service
template to use</font>
<br><font size=2 face="sans-serif"> host_name
localhost</font>
<br><font size=2 face="sans-serif"> service_description
Total Processes</font>
<br><font size=2 face="sans-serif"> is_volatile
0</font>
<br><font size=2 face="sans-serif"> check_period
24x7</font>
<br><font size=2 face="sans-serif"> max_check_attempts
4</font>
<br><font size=2 face="sans-serif"> normal_check_interval
5</font>
<br><font size=2 face="sans-serif"> retry_check_interval
1</font>
<br><font size=2 face="sans-serif"> contact_groups
admins</font>
<br><font size=2 face="sans-serif"> notification_interval
960</font>
<br><font size=2 face="sans-serif"> notification_period
24x7</font>
<br><font size=2 face="sans-serif"> check_command
check_local_procs!250!400</font>
<br><font size=2 face="sans-serif"> }</font>
<br>
<br><font size=2 face="sans-serif"># Define a service to check the number
of currently logged in</font>
<br><font size=2 face="sans-serif"># users on the local machine. Warning
if > 20 users, critical</font>
<br><font size=2 face="sans-serif"># if > 50 users.</font>
<br>
<br><font size=2 face="sans-serif">define service{</font>
<br><font size=2 face="sans-serif"> use
generic-service ; Name of service
template to use</font>
<br><font size=2 face="sans-serif"> host_name
localhost</font>
<br><font size=2 face="sans-serif"> service_description
Current Users</font>
<br><font size=2 face="sans-serif"> is_volatile
0</font>
<br><font size=2 face="sans-serif"> check_period
24x7</font>
<br><font size=2 face="sans-serif"> max_check_attempts
4</font>
<br><font size=2 face="sans-serif"> normal_check_interval
5</font>
<br><font size=2 face="sans-serif"> retry_check_interval
1</font>
<br><font size=2 face="sans-serif"> contact_groups
admins</font>
<br><font size=2 face="sans-serif"> notification_interval
960</font>
<br><font size=2 face="sans-serif"> notification_period
24x7</font>
<br><font size=2 face="sans-serif"> check_command
check_local_users!20!50</font>
<br><font size=2 face="sans-serif"> }</font>
<br>
<br><font size=2 face="sans-serif"># Define a service to "ping"
the local machine</font>
<br>
<br><font size=2 face="sans-serif">define service{</font>
<br><font size=2 face="sans-serif"> use
generic-service ; Name of service
template to use</font>
<br><font size=2 face="sans-serif"> host_name
localhost</font>
<br><font size=2 face="sans-serif"> service_description
PING</font>
<br><font size=2 face="sans-serif"> is_volatile
0</font>
<br><font size=2 face="sans-serif"> check_period
24x7</font>
<br><font size=2 face="sans-serif"> max_check_attempts
4</font>
<br><font size=2 face="sans-serif"> normal_check_interval
5</font>
<br><font size=2 face="sans-serif"> retry_check_interval
1</font>
<br><font size=2 face="sans-serif"> contact_groups
admins</font>
<br><font size=2 face="sans-serif"> notification_interval
960</font>
<br><font size=2 face="sans-serif"> notification_period
24x7</font>
<br><font size=2 face="sans-serif"> check_command
check_ping!100.0,20%!500.0,60%</font>
<br><font size=2 face="sans-serif"> }</font>
<br>
<br><font size=2 face="sans-serif"># Generic service definition template
- This is NOT a real service, just a template!</font>
<br>
<br><font size=2 face="sans-serif">define service{</font>
<br><font size=2 face="sans-serif"> name
generic-service ; The 'name' of this service template</font>
<br><font size=2 face="sans-serif"> active_checks_enabled
1 ; Active service
checks are enabled</font>
<br><font size=2 face="sans-serif"> passive_checks_enabled
1 ; Passive service
checks are enabled/accepted</font>
<br><font size=2 face="sans-serif"> parallelize_check
1
; Active service checks should be parallelized (disabling this can lead
to major performance problems)</font>
<br><font size=2 face="sans-serif"> obsess_over_service
1 ; We should
obsess over this service (if necessary)</font>
<br><font size=2 face="sans-serif"> check_freshness
1
; Default is to NOT check service 'freshness'</font>
<br><font size=2 face="sans-serif"> notifications_enabled
1 ; Service notifications
are enabled</font>
<br><font size=2 face="sans-serif"> event_handler_enabled
1 ; Service event
handler is enabled</font>
<br><font size=2 face="sans-serif"> flap_detection_enabled
1 ; Flap detection
is enabled</font>
<br><font size=2 face="sans-serif"> failure_prediction_enabled
1 ; Failure prediction is enabled</font>
<br><font size=2 face="sans-serif"> process_perf_data
1
; Process performance data</font>
<br><font size=2 face="sans-serif"> retain_status_information
1 ; Retain status information
across program restarts</font>
<br><font size=2 face="sans-serif"> retain_nonstatus_information
1 ; Retain non-status information across
program restarts</font>
<br><font size=2 face="sans-serif"> register
0 ; DONT REGISTER THIS DEFINITION - ITS NOT
A REAL SERVICE.</font>
<br><font size=2 face="sans-serif"> }</font>
<br>
<br>
<br><font size=2 face="sans-serif">COMMANDS:</font>
<br>
<br><font size=2 face="sans-serif"># 'check_local_load' command definition</font>
<br><font size=2 face="sans-serif">define command{</font>
<br><font size=2 face="sans-serif"> command_name
check_local_load</font>
<br><font size=2 face="sans-serif"> command_line
$USER1$/check_load -w $ARG1$ -c $ARG2$</font>
<br><font size=2 face="sans-serif"> }</font>
<br>
<br><font size=2 face="sans-serif"># 'check_ping' command definition</font>
<br><font size=2 face="sans-serif">define command{</font>
<br><font size=2 face="sans-serif"> command_name
check_ping</font>
<br><font size=2 face="sans-serif"> command_line
$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p
5</font>
<br><font size=2 face="sans-serif"> }</font>
<br>
<br><font size=2 face="sans-serif"># 'check_local_disk' command definition</font>
<br><font size=2 face="sans-serif">define command{</font>
<br><font size=2 face="sans-serif"> command_name
check_local_disk</font>
<br><font size=2 face="sans-serif"> command_line
$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$</font>
<br><font size=2 face="sans-serif"> }</font>
<br>
<br><font size=2 face="sans-serif"># 'check_local_users' command definition</font>
<br><font size=2 face="sans-serif">define command{</font>
<br><font size=2 face="sans-serif"> command_name
check_local_users</font>
<br><font size=2 face="sans-serif"> command_line
$USER1$/check_users -w $ARG1$ -c $ARG2$</font>
<br><font size=2 face="sans-serif"> }</font>
<br>
<br><font size=2 face="sans-serif"># 'check_local_procs' command definition</font>
<br><font size=2 face="sans-serif">define command{</font>
<br><font size=2 face="sans-serif"> command_name
check_local_procs</font>
<br><font size=2 face="sans-serif"> command_line
$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$</font>
<br><font size=2 face="sans-serif"> }</font>
<br>
<br>