Cool Solutions

check_oes_stat plugin for Nagios



By:

August 12, 2010 10:12 am

Reads: 7789

Comments:3

License:
Free

Download check_oes_stat

check_oes_stat script is an attempt to do for OES2/Linux servers a portion of what mrtgext.nlm did for NetWare servers. In conjunction with Nagios and NRPE, this script can return statistics on NCP Connections, NCP uptime, NCP Open Files, and DS Version.

You need to have a functional nagios installation and nrpe on the target server. Rainer Brunold has an excellent article, “Nagios 3.0 – A Extensible Host and Service Monitoring” at http://www.novell.com/coolsolutions/feature/19807.html that describes how to get it all setup and configured.

For this script, simply download and install in your plugins directory on the server to be monitored. Then edit the nrpe.cfg file, adding the following lines:

command[check_oes_edir_ver]=sudo /usr/lib/nagios/plugins/check_oes_stat -v DSVER
command[check_oes_conns]=sudo /usr/lib/nagios/plugins/check_oes_stat -v CONNS
command[check_oes_uptime]=sudo /usr/lib/nagios/plugins/check_oes_stat -v UPTIME
command[check_oes_ofiles]=sudo /usr/lib/nagios/plugins/check_oes_stat -v OFILES

This script uses the ‘ncpcon’ and ‘ndsstat’, which can only be run as the root user, hence the use of ‘sudo’ above. So you must also add to your sudoers file (using ‘visudo’) the following line (assumes nrpe is running as user nagios):

nagios ALL=NOPASSWD:/usr/lib/nagios/plugins/

Then on your nagios server just add the services, something like:

define service{
        use                     oes-service
        service_description     NCP Connections
        check_command           check_nrpe!check_oes_conns
        service_groups          oesservices
        hostgroup_name          oesservers
}

define service{
        use                     oes-service
        service_description     NCP Open files
        check_command           check_nrpe!check_oes_ofiles
        service_groups          oesservices
        hostgroup_name          oesservers
}

etc.

Limitations: this tool doesn’t accept values for ‘warning’ or ‘critical’ levels like most other nagios plugins, but the output is well suited for graphing with an add-on like nagiosgraph. (See Rainer Brunold’s article “Nagios 3.0 Extension – NagiosGraph” at http://www.novell.com/coolsolutions/feature/19843.html)

To graph NCP connections using nagiosgraph, add the following to your map file:

# Service type: NCP connections (OES2 servers)
# output: NCP Conn Slots Used = 415, NotLoggedIn Conns = 264, Licensed Conns = 34 
# perfdata: ncpconns=415;264;34
/output:NCP Conn Slots Used = (\d+), NotLoggedIn Conns = (\d+), Licensed Conns = (\d+)/
and push @s, [ ncpconns,
                [ slots_used, GAUGE, $1 ],
                [ nli_cons, GAUGE, $2 ],
                [ licensed, GAUGE, $3 ],
        ];

You could similarly chart Open Files as well.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)


Categories: Uncategorized

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

3 Comments

  1. By:aschneck

    Hi,
    this script tries to include antoher scipt, that doesnt exists:
    . ${PROGPATH}/utils.sh

    Please explain what this utils.sh should be for

    Axel

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    • By:mstatman

      The utils.sh is included in a nagios distribution, which is where this plugin was intended to be run. But it can run stand-alone; the primary things that it’s getting from utils.sh are the following definitions:

      STATE_OK=0
      STATE_WARNING=1
      STATE_CRITICAL=2
      STATE_UNKNOWN=3
      STATE_DEPENDENT=4

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
  2. By:ElliottRScott

    I see that in your service definitions, you’re using a template called oes-service. Would you be kind enough to share what that looks like? I’m happy to create my own, but I’d like to compare notes. Thanks!

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)

Comment

RSS