sqlservers and nagios

Jim Avery jim at jimavery.me.uk
Fri Sep 18 17:21:32 CEST 2009


2009/9/18 Melanie Pfefer <melanie_pfefer at yahoo.co.uk>:
> Hi
>
> I have a shell script that connects to each SQL server I have.
>
> I want to integrate this is nagios 2.
>
> However, I noticed that nagios relies on HOSTNAME and HOSTADDRESS and HOSTGROUP. While I am more interested in the servername: For example, I could have 2 sql servers hosted on the same machine.
>
> Currently my shell script connects to a SQL server.
>
>
> Could you please share your thoughts on this? Should I 'fool' nagios and put servernames as hostnames? Or it is not necessary to define the sql servers in nagios?
>
> thank you in advance.

You can define two service checks for the same host.

for example:

define service{
  use                     generic-service
  host_name               asqlhost
  service_description     sql_DatabaseA
  check_command           check_mssql!-H $HOSTADDRESS$:2674 -U
username -P $USER8$ -d DATABASEA
  notes                   Checks whether we can establish a connection
to the MS SQL Server model database.
}

# Here we monitor a specific instance.
define service{
  use                   generic-service
  host_name             asqlhost
  service_description   sql_DatabaseB
  check_command         check_mssql!-H $HOSTADDRESS$:1375 -U username
-P $USER8$ -d DATABASEB
  notes                 Checks whether we can establish a connection
to the MS SQL Server database.
}



Precisely what syntax you use depends on how you access the database,
how your command definition is constructed and whether (as I have)
you've tweaked the check_mssql plugin.  Hopefully this will give you
the general idea though.

If the SQL servers are hosted as cluster services, that's a different
matter altogether - I'm assuming you're not doing that.

hth,

Jim

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list