check_nwc_health
check_nwc_health copied to clipboard
--warningx and --criticalx are not recognized properly in some checks
Every test was made on checkpoint
With --mode hardware-health
the arguments do what they should do.
With --mode cpu-usage
or --mode fw-connections
or most other modes the given arguments are shown in the perf data but the state itself uses the default value. Also some modes give an error message like Use of uninitialized value $warn in sprintf at ./check_nwc_health line 422
if just one argument is used. In this case --criticalx
is used. The warn threshold is completely removed from the perf data
exmaple:
$ ./check_nwc_health --community xxxxx --hostname 1.2.3.4 --mode fw-connections
CRITICAL - policy default has 89239 open connections, vsx FILTER01 has 89239 open connections | 'fw_policy_numconn'=89239;;;; 'vsx_FILTER01_numconn'=89239;20000;23000;;
$ ./check_nwc_health --community xxxxx --hostname 1.2.3.4 --mode fw-connections --criticalx vsx_FILTER01_numconn=120000
CRITICAL - policy default has 92667 open connections, vsx FILTER01 has 92667 open connections | 'fw_policy_numconn'=92667;;;; 'vsx_CPFILTER01_numconn'=92667;20000;120000;;