Page 1 of 1

Solution needed - nagios + windows 2008 with nsclient++

Posted: Wed Nov 16, 2016 3:04 am
by mkiler1
hello,
I have working nagios and I'm able to receive information from Windows 2008 machine using nsclient++.
But now I would like to monitor from this Windows machine remote port on remote machine. Monitor - only check like telnet, I need check only that they can respond.
Please tell me how to do that. I can do that on linux using NRPE, but I don't have idea how to do that on Windows

Re: Solution needed - nagios + windows 2008 with nsclient++

Posted: Wed Nov 16, 2016 11:27 am
by rkennedy
You'll need to find applicable Windows plugins that can do this, or write your own. The best place to look is @ https://exchange.nagios.org

From there, you'll want to use the external scripts section in NSClient++ to 'proxy' your checks through this Windows Machine. Nagios executes check_nrpe -> your windows server evaluates what command was called -> your windows command then executes whatever script you're after.

It sounds like a bit more work than needed, but if you really need to jump through the host then I understand. It'll take some testing on your end to get it working fully. This document might help you - https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Re: Solution needed - nagios + windows 2008 with nsclient++

Posted: Thu Nov 17, 2016 2:43 am
by mkiler1
ok, thanks, for links
But is someone here who is doing this? I can't write my own script :(

What I need - check smtp on port 25 but directly from host which conecting to this smtp, not from other host with nagios,

Re: Solution needed - nagios + windows 2008 with nsclient++

Posted: Thu Nov 17, 2016 3:05 pm
by avandemore
The plugin check_tcp should do what you want:

Code: Select all

# /usr/local/nagios/libexec/check_tcp -h
check_tcp v2.0.3 (nagios-plugins 2.0.3)
Copyright (c) 1999 Ethan Galstad <[email protected]>
Copyright (c) 1999-2014 Nagios Plugin Development Team
        <[email protected]>

This plugin tests TCP connections with the specified host (or unix socket).

Usage:
check_tcp -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>]
[-e <expect string>] [-q <quit string>][-m <maximum bytes>] [-d <delay>]
[-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j]
[-D <warn days cert expire>[,<crit days cert expire>]] [-S <use SSL>] [-E]

Options:
 -h, --help
    Print detailed help screen
 -V, --version
    Print version information
 --extra-opts=[section][@file]
    Read options from an ini file. See
    https://www.nagios-plugins.org/doc/extra-opts.html
    for usage and examples.
 -H, --hostname=ADDRESS
    Host name, IP Address, or unix socket (must be an absolute path)
 -p, --port=INTEGER
    Port number (default: none)
 -4, --use-ipv4
    Use IPv4 connection
 -6, --use-ipv6
    Use IPv6 connection
 -E, --escape
    Can use \n, \r, \t or \ in send or quit string. Must come before send or quit option
    Default: nothing added to send, \r\n added to end of quit
 -s, --send=STRING
    String to send to the server
 -e, --expect=STRING
    String to expect in server response (may be repeated)
 -A, --all
    All expect strings need to occur in server response. Default is any
 -q, --quit=STRING
    String to send server to initiate a clean close of the connection
 -r, --refuse=ok|warn|crit
    Accept TCP refusals with states ok, warn, crit (default: crit)
 -M, --mismatch=ok|warn|crit
    Accept expected string mismatches with states ok, warn, crit (default: warn)
 -j, --jail
    Hide output from TCP socket
 -m, --maxbytes=INTEGER
    Close connection once more than this number of bytes are received
 -d, --delay=INTEGER
    Seconds to wait between sending string and polling for response
 -D, --certificate=INTEGER[,INTEGER]
    Minimum number of days a certificate has to be valid.
    1st is #days for warning, 2nd is critical (if not specified - 0).
 -S, --ssl
    Use SSL for the connection.
 -w, --warning=DOUBLE
    Response time to result in warning status (seconds)
 -c, --critical=DOUBLE
    Response time to result in critical status (seconds)
 -t, --timeout=INTEGER
    Seconds before connection times out (default: 10)
 -v, --verbose
    Show details for command-line debugging (Nagios may truncate output)

Send email to [email protected] if you have questions regarding use
of this software. To submit patches or suggest improvements, send email to
[email protected]