mssql_server.py

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
Auel
Posts: 6
Joined: Wed Feb 19, 2020 7:37 am

mssql_server.py

Post by Auel »

define service{
use generic-service
host_name BTP
service_description SQL
check_command check_mssql_database.py -H BTP -U nagios -P XXXX -T XXXXXX -p 1433 --cpu -w 50 -c 80
}

not working. I use Nagios Core.

Please,can someone give me an example of how to define the service of this plugins?
mssql_server.py
Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: mssql_server.py

Post by scottwilkerson »

First you need to make a command definition
See:

Code: Select all

https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/objectdefinitions.html#command
such as

Code: Select all

define command {
    command_name    check_mssql_database
    command_line    $USER1$/check_mssql_database.py -H $HOSTADDRESS$ $ARG1$
}
then you would change your check_command to something like this

Code: Select all

check_command    check_mssql_database!-U nagios -P XXXX -T XXXXXX -p 1433 -w 50 -c 80 --activetrans
The plugin I have has the following usage, but yours may vary

Code: Select all

# /usr/local/nagios/libexec/check_mssql_database.py -h
Usage: check_mssql_database.py -H hostname -U user -P password -T table --mode

Options:
  -h, --help            show this help message and exit

  Required Options:
    -H HOSTNAME, --hostname=HOSTNAME
                        Specify MSSQL Server Address
    -U USER, --user=USER
                        Specify MSSQL User Name
    -P PASSWORD, --password=PASSWORD
                        Specify MSSQL Password
    -T TABLE, --table=TABLE
                        Specify the table to check

  Optional Connection Information:
    -I INSTANCE, --instance=INSTANCE
                        Specify instance
    -p PORT, --port=PORT
                        Specify port.

  Nagios Plugin Information:
    -w WARNING, --warning=WARNING
                        Specify warning range.
    -c CRITICAL, --critical=CRITICAL
                        Specify critical range.

  Mode Options:
    --logshrinks        Log Shrinks
    --transpsec         Transactions Per Second
    --logfileusage      Log File Usage
    --logwait           Log Flush Wait Time
    --datasize          Database Size
    --activetrans       Active Transactions
    --logflushes        Log Flushes Per Second
    --logcachehit       Log Cache Hit Ratio
    --loggrowths        Log Growths
    --test              Run tests of all queries against the database.
    --time2connect      Time to connect to the database.
    --logtruncs         Log Truncations
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked