New Nagios plugins

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
sciencedicas
Posts: 15
Joined: Tue Dec 06, 2011 9:28 am

New Nagios plugins

Post by sciencedicas »

I've downloaded a plugin check_mssql_health-1.5.19.3.tar.gz
since I would like to monitor a MS SQL Server that I have in-house.

since I'm new to Nagios I not sure what is the next step.

my question is , is untar this file inside /Usr/local/nagios/libexec the only thing needed to work with this plugin ?

I can pretty much lock on my own how to work with the plugins, but can't find how to integrate the plugin with Nagios in the first place

I'm posting this message after 3.5 hours searching on how to do it. and I don;t have the answer yet.

thank you in advance and sorry if this is a silly question.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: New Nagios plugins

Post by Box293 »

sciencedicas wrote:my question is , is untar this file inside /Usr/local/nagios/libexec the only thing needed to work with this plugin ?
You have extracted it to the correct location, you're off to a good start.

You need to create a command in nagios that uses the plugin. It's easiest to look at an existing command as reference.

In the file:
/usr/local/nagios/etc/objects/commands.cfg
There is a command like so:

Code: Select all

# 'check_ping' command definition
define command{
        command_name    check_ping
        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
        }
In the file:
/usr/local/nagios/etc/objects/localhost.cfg
There is a service definition like so:

Code: Select all

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%
        }
To start off with, $USER1$ refers to /usr/local/nagios/libexec:

Now if I compare the command against the service definition:

Code: Select all

$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
check_ping!100.0,20%!500.0,60%
check_ping was the name of the command defined in commands.cfg
Then an exclamation mark is used ! to separate the command_name and $ARG1$
The next value is $ARG1$ (100.0,20%)
Then an exclamation mark is used ! to separate $ARG1$ and $ARG2$
The next value is $ARG2$ (500.0,60%)

What is executed by Nagios is:

Code: Select all

/usr/local/nagios/libexec/check_ping -H 127.0.0.1 -w 100.0,20% -c 500.0,60% -p 5
Which returns something like:

Code: Select all

PING OK - Packet loss = 0%, RTA = 0.10 ms|rta=0.099000ms;100.000000;500.000000;0.000000 pl=0%;20;60;0
So what you need to do is:
  • Test the plugin on the command line first so you know how it needs to be defined
    Create a command in commands.cfg
    Create a service in the <your_monitored_server>.cfg file that uses the command_name you defined in commands.cfg and supplies the relevant arguments
Does this make sense?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked