lausser / check_nwc_health

nwc = network component. This plugin checks lots of aspects of routers, switches, wlan controllers, firewalls,.....
http://labs.consol.de/nagios/check_nwc_health
GNU General Public License v2.0
148 stars 88 forks source link

Thresholds for check-licenses sla_remaining_days make no sense #333

Open ggiesen opened 1 month ago

ggiesen commented 1 month ago

So if I run the plugin with no explicit thresholds, then defaults of 7 days for warning and 2 days for critical make sense (79 days remaining means it's OK):

/usr/lib64/nagios/plugins/check_nwc_health -H <removed> --mode check-licenses --community <removed> --verbose
OK - entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized, compliance status is AUTHORIZED, authorization will expire in 79 days
checking keys
entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized
Registration status is registrationCompleted
compliance status is AUTHORIZED
authorization will expire in 79 days | 'sla_remaining_days'=79;7:;2:;;

However, if I explicitly set the thresholds:

/usr/lib64/nagios/plugins/check_nwc_health -H <removed> --mode check-licenses --community <removed> --verbose --warningx 'sla_remaining_days'=7 --criticalx 'sla_remaining_days'=2
CRITICAL - authorization will expire in 79 days, entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized, compliance status is AUTHORIZED
checking keys
entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized
Registration status is registrationCompleted
compliance status is AUTHORIZED
authorization will expire in 79 days | 'sla_remaining_days'=79;7;2;;

I get a CRITICAL result (for the same thresholds).

Furthermore, it looks like it's expecting the threshold to be higher rather than lower (which is the opposite of what it should be - more days left = better):

Setting the warningx threshold lower than the current value results in WARNING:

/usr/lib64/nagios/plugins/check_nwc_health -H <removed> --mode check-licenses --community <removed> --verbose --warningx 'sla_remaining_days'=78
WARNING - authorization will expire in 79 days, entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized, compliance status is AUTHORIZED
checking keys
entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized
Registration status is registrationCompleted
compliance status is AUTHORIZED
authorization will expire in 79 days | 'sla_remaining_days'=79;78;2:;;

Set the warningx threshold higher than the current value results in OK:

$ /usr/lib64/nagios/plugins/check_nwc_health -H <removed> --mode check-licenses --community <removed> --verbose --warningx 'sla_remaining_days'=80
OK - entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized, compliance status is AUTHORIZED, authorization will expire in 79 days
checking keys
entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized
Registration status is registrationCompleted
compliance status is AUTHORIZED
authorization will expire in 79 days | 'sla_remaining_days'=79;80;2:;;