Under linux, at least centos and I think also debian, there is a "iptables" listed in the daemons. But it is really a script to load and save them, it doesn' start a process, neither write a pidfile.
How can I check iptables up and running with monit ?
For CentOS 6 and earlier you're correct about it using
iptables
. CentOS 7 usesfirewalld
.To monitor either using Monit you can use PROGRAM-STATUS-TEST. There are several methods to ascertain the status of
iptables
.One method to get the status of
iptables
in CentOS 6 is to useIf
iptables
is not running you'll get the following response:If
iptables
is running it will look similar to this:Write a script to check the status and grep for
Firewall is not running
and provide an return code for the script then usemonit
to run the script.I didn't test it but it would look something like this: