Page 1 of 1

check_iptables

Posted: Tue Dec 31, 2013 9:54 am
by jaynv0i
I am trying to get the check_iptables plugin working to allow me to monitor one of our server's firewall rules. I have been looking at this problem long enough, the problem is proably staring me in the face, and I cannot see it.

My monitoring server is Nagios Core 3.4.1 on top of Debian Wheezy. The server I am monitoring is also Debian Wheezy.

The command configuration (check_iptables.cfg) is defined as follows.

define command{
command_name check_iptables
command_line /usr/lib/nagios/plugins/check_iptables.sh -T '$ARG1$' -r '$ARG2$'
}

The check is being called using the following
define service{
use generic-service
host_name DNS-SRVR-02
service_description IPTables
check_command check_iptables!INPUT!103
}


The result I am receiving is "Usage: /usr/lib/nagios/check_iptables.sh -T <table> -r <min rules>. I am able to run this command from the command line as the nagios user without any problem.

What am I missing?

Thank you in advance for your assistance, and I hope everyone has a happy new year.

Jay

Re: check_iptables

Posted: Thu Jan 02, 2014 12:19 pm
by abrist
Just for testing purposes, is the following plugin the one that you are using?
http://exchange.nagios.org/directory/Pl ... es/details

Re: check_iptables

Posted: Fri Jan 03, 2014 7:52 am
by jaynv0i
Yes, that is the plugin I am using. As a test, I gave the nagios user permission to run the plugin using sudoers. I am able to run the plugin from the command line on the server being monitored, while logged is as the nagios user. However, when the command is run from the monitoring station, I receive the error.

I am at a loss at this point.

Thank you for your help.

Re: check_iptables

Posted: Fri Jan 03, 2014 10:40 am
by slansing
Well, what are the differences between what you are running on the remote system, and on the Nagios server? The output you are seeing is not a specific critical error, it's simply telling you that you defined the command, or service definition as the options you specified are not valid. Can you show us an example of how you are running this on the nagios command line, as well as the output? That will likely point to the problem.

Re: check_iptables

Posted: Thu Jan 09, 2014 5:48 pm
by jaynv0i
I am sorry for the delay in posting back. You got me on the right track. I had specified the command incorrectly on the remote server. Apparently I cannot copy and paste very well.

Thank you for your help.

Re: check_iptables

Posted: Thu Jan 09, 2014 5:51 pm
by slansing
Excellent!