<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.17">
<TITLE>RE : [Nagios-users] Sybase check on windows servers</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hi,<BR>
<BR>
>I am using nagios2.9 and Nagios plugins 1.4.9.<BR>
><BR>
>I have made a hostgroup for Sybase servers of the sort-<BR>
><BR>
>define hostgroup{<BR>
> hostgroup_name sybase<BR>
> alias Sybase Servers<BR>
> members machine1,machine2,machine3,machine4,machine5<BR>
> }<BR>
><BR>
>Now I want to know if its possible to define a single service for all<BR>
>these machines as the service name differs in each server because it is-<BR>
>Sybsql-machine1,sybsql_machine2,sybsql_machine3 etc.<BR>
><BR>
>Can you please also provide me help on command definition and service<BR>
>definition for Sybase check on linux machines.<BR>
<BR>
Here is a small test I done to validate that using HOSTNAME in serice definition is OK.<BR>
You can adapt this exemple with your real commands.<BR>
<BR>
I use the dummy check to verify if the hostname is well read by the command. This plugin take in first argument the return value, and in second the status message.<BR>
I have two hosts, host1 and host2, and a hostgroup containing the two hosts.<BR>
I then define the service on the hostgroup.<BR>
I use the $HOSTNAME$ macro in service definition to specify parameters.<BR>
<BR>
<BR>
##################################<BR>
# Command definition<BR>
<BR>
# 'check_dummy' command definition<BR>
define command{<BR>
command_name check_dummy<BR>
command_line $USER1$/check_dummy $ARG1$ $ARG2$<BR>
}<BR>
<BR>
<BR>
##################################<BR>
# hosts definition definition<BR>
<BR>
<BR>
define host{<BR>
use linux-server<BR>
host_name host1<BR>
alias Host1<BR>
address 127.0.0.1<BR>
}<BR>
define host{<BR>
use linux-server<BR>
host_name host2<BR>
alias Host2<BR>
address 127.0.0.1<BR>
}<BR>
<BR>
##################################<BR>
# Hostgroup definition<BR>
<BR>
define hostgroup{<BR>
hostgroup_name Sybase ; The name of the hostgroup<BR>
alias Sybase servers ; Long name of the group<BR>
members host1,host2 ; Comma separated list of hosts that belong to this group<BR>
}<BR>
<BR>
##################################<BR>
# Service definition<BR>
<BR>
define service{<BR>
use local-service<BR>
hostgroup_name Sybase ; I specify here the hostgroup<BR>
service_description Sybase<BR>
check_command check_dummy!0!SYBSQL_$HOSTNAME$ ; The $HOSTNAME$ will be replaced by Nagios by the name of the host<BR>
}<BR>
<BR>
<BR>
In nagios console, I then have :<BR>
host1 Sybase OK: SYBSQL_host1<BR>
host2 Sybase OK: SYBSQL_host2<BR>
<BR>
<BR>
<BR>
Best regards,<BR>
<BR>
Florent</FONT>
</P>
</BODY>
</HTML>