[Nagiosplug-help] nagios plugins

Ian Rarity Ian.Rarity at espc.com
Wed Feb 3 14:02:36 CET 2010


First off, you'll probably want to change ownership/permissions of the plugin; when Nagios runs it, it'll do so as the "nagios" user, not root.  As for the other two:

Check command:  Open up /usr/local/nagios/etc/commands.cfg and add something like:

define command{
        command_name    check_iptables
        command_line    $USER1$/check_iptables.sh
        }

Add any other options here that you need to pass to the plugin.  Then, create a service definition that uses that command.  This will (probably) go into /usr/local/nagios/etc/services.cfg, and look like:

define service{
        use                             generic-service
        host_name
        contact_groups
        service_description             iptables
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           5
        retry_check_interval            1
        notification_interval           120
        notification_period             24x7
        notification_options            w,u,c,r
        check_command                   check_iptables
        }

Fill in the hostname and contact group fields with whatever makes sense.

Ta,
IR.

=-=-=-=-=-=-=-=-=-=-=
Ian Rarity
IT Services Engineer
ESPC (UK) Ltd.
0131-624-8000
07823-530-317
ian.rarity at espc.com
=-=-=-=-=-=-=-=-=-=-=

From: mostafa yasin [mailto:mostafayasin at hotmail.co.uk]
Sent: 03 February 2010 10:00
To: nagiosplug-help at lists.sourceforge.net
Subject: Re: [Nagiosplug-help] nagios plugins

Dear Sir;

Thank you very much for your help. I have copied the script into /usr/local/nagios/libexec
and it 's executable and owned by root user. when i run the script manually, it 's running.
But how to:

-          Write a check command that calls the plugin; if you don't know it already, you'll be able to work out the syntax by looking at some of the other check commands in your nagios /etc/ directory, in commands.cfg.
-          Add a service definition for your iptables host that uses the check command.


---
Best Regards,,

Mostafa Yasin
Linux System Engineer.

________________________________
Follow us on Twitter at http://twitter.com/espc

Private and Confidential: This e-mail transmission is strictly confidential and intended solely for the addressee. It may contain privileged and confidential information and if you are not the intended recipient, you must not copy, disclose, distribute or take any action in reliance on it. If you have received this e-mail in error, please delete it and notify our E-mail Systems Administrator on +44 (0) 131 624 8000. ESPC (UK) Ltd does not accept any liability for any harm that may be caused to the recipient's system or data by this message or any attachment.

ESPC (UK) Ltd is a company registered under the Companies Acts in Scotland (Registered Number SC203585), and having its registered office at 90A George Street, Edinburgh, Midlothian EH2 3DF.

ESPC (UK) Ltd is an Appointed Representative of Accord Consultancy which is authorised and regulated by the Financial Services Authority.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20100203/b1fa17cb/attachment.html>


More information about the Help mailing list