nagios-nrpe: check_minifirewall use wrong path #66

Closed
opened 2019-07-03 10:16:15 +02:00 by benpro · 6 comments
Contributor

For buster, alert5 is now a systemd unit file + a script.
It is not anymore /etc/init.d/alert5.

check_minifirewall is using this path but that should be /usr/share/scripts/alert5.sh for buster.

For buster, alert5 is now a systemd unit file + a script. It is not anymore `/etc/init.d/alert5`. check_minifirewall is using this path but that should be `/usr/share/scripts/alert5.sh` for buster.
benpro added this to the Debian 11 (Buster) milestone 2019-07-03 10:16:15 +02:00
benpro added the
bug
label 2019-07-03 10:16:15 +02:00
Author
Contributor

The real problem is in fact in /usr/local/lib/nagios/plugins/check_minifirewall line 13.

systemctl is-active alert5 | grep -q "^active$"                 

You cannot check using this way because this is a one shot service, there is no active state.

The real problem is in fact in `/usr/local/lib/nagios/plugins/check_minifirewall` line 13. ``` systemctl is-active alert5 | grep -q "^active$" ``` You cannot check using this way because this is a one shot service, there is no active state.
Author
Contributor

So maybe use is-enabled?

root@hosting08:~# systemctl is-enabled alert5 
enabled
So maybe use is-enabled? ``` root@hosting08:~# systemctl is-enabled alert5 enabled ```
Author
Contributor

Even systemctl is-enabled alert5 -q would be sufficient.

Even ```systemctl is-enabled alert5 -q``` would be sufficient.
Author
Contributor

Check out 755eaab60a. If it seems good for you, close this issue 😄
(No need for grep as systemctl return the right exit code.)

Check out 755eaab60a. If it seems good for you, close this issue :smile: (No need for grep as systemctl return the right exit code.)
jlecour was assigned by benpro 2019-07-04 17:44:31 +02:00
Owner

I'm pretty sure you're right.

I'm just puzzled by the fact that on a fresh install I get this :

root@buster:~# bash -x /usr/local/lib/nagios/plugins/check_minifirewall
+ main
+ is_alert5_enabled
+ test -f /etc/init.d/alert5
+ grep -q '^active$'
+ systemctl is-enabled alert5
+ is_minifirewall_started
+ test -x /usr/share/scripts/minifirewall_status
+ /usr/share/scripts/minifirewall_status
+ return_ok 'Minifirewall is not started and Alert5 script is not enabled.'
+ echo 'OK: Minifirewall is not started and Alert5 script is not enabled.'
OK: Minifirewall is not started and Alert5 script is not enabled.
+ exit 0

the return code should not be 0.
I'll take a look at it

I'm pretty sure you're right. I'm just puzzled by the fact that on a fresh install I get this : ``` root@buster:~# bash -x /usr/local/lib/nagios/plugins/check_minifirewall + main + is_alert5_enabled + test -f /etc/init.d/alert5 + grep -q '^active$' + systemctl is-enabled alert5 + is_minifirewall_started + test -x /usr/share/scripts/minifirewall_status + /usr/share/scripts/minifirewall_status + return_ok 'Minifirewall is not started and Alert5 script is not enabled.' + echo 'OK: Minifirewall is not started and Alert5 script is not enabled.' OK: Minifirewall is not started and Alert5 script is not enabled. + exit 0 ``` the return code should not be 0. I'll take a look at it
Owner

Your fix looks good to me. 👏
Thanks.

Your fix looks good to me. :clap: Thanks.
Sign in to join this conversation.
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: evolix/ansible-roles#66
No description provided.