Re: service firewall check
Posted: Tue Jun 16, 2015 2:14 am
on client:
on server:
IF i run the code below on the nagios server:
value $T1 = empty
if i remove sudo in the code:
the output on the nagios server will always be:
Code: Select all
[root@name~]# /etc/init.d/firewall status
firewall is running
[root@name~]# service firewall stop
Deleting firewall packet filter [ OK ]
[root@name~]# /etc/init.d/firewall status
firewall is stopped
[root@name~]# service firewall start
Installing Firewall packet filter WARNING: All config files need .conf: /etc/modprobe.d/block-ipv6.config, it will be ignored in a future release.
WARNING: All config files need .conf: /etc/modprobe.d/block-ipv6.config, it will be ignored in a future release.
WARNING: All config files need .conf: /etc/modprobe.d/block-ipv6.config, it will be ignored in a future release.
WARNING: All config files need .conf: /etc/modprobe.d/block-ipv6.config, it will be ignored in a future release.
WARNING: All config files need .conf: /etc/modprobe.d/block-ipv6.config, it will be ignored in a future release.
WARNING: All config files need .conf: /etc/modprobe.d/block-ipv6.config, it will be ignored in a future release.
[ OK ]
[root@name~]#
Code: Select all
[root@monitoring ~]# /etc/init.d/firewall status
-bash: /etc/init.d/firewall: No such file or directory
[root@monitoring ~]#Code: Select all
[root@monitoring ~]# /usr/lib64/nagios/plugins/check_nrpe -H externalip.com -c firewall_check
Status 2 - Information : firewall is unknown -
[root@monitoring ~]#if i remove sudo in the code:
Code: Select all
T1=$(sudo /etc/init.d/$SERVICE status)Code: Select all
[root@monitoring ~]# /usr/lib64/nagios/plugins/check_nrpe -H externalip.com -c firewall_check
Status 1 - Critical : firewall is stopped