File check_susefirewall.sh of Package monitoring-plugins-susefirewall
#!/bin/sh
#
# author: Joerg Heinemann
# website: http://enterprise-log-management-appliance.org
# license: GPL v3
#
# /usr/lib/nagios/plugins/check_susefirewall/check_susefirewall.sh
#
# check_susefirewall plugin for Nagios 3.x
#
# Tested on openSUSE 12.3-13.1.
#
# Description:
#
# This plugin will check if openSUSE Firewall is running.
#
# Example of command definitions for Nagios 3.x:
#
# define command{
# command_name check_susefirewall
# command_line $USER1$/check_susefirewall.sh
# }
SUMMARY=$(systemctl is-active SuSEfirewall2.service)
systemctl -q is-active SuSEfirewall2.service; RETVAL="$?"
case $RETVAL in
0)
echo "openSUSE Firewall OK - $SUMMARY"
exit 0
;;
*)
echo "openSUSE Firewall CRITICAL - $SUMMARY"
exit 2
;;
esac