nagios-plugins
nagios-plugins copied to clipboard
Check_service regex problems
Hello,
so I was testing out your check_service.sh script and i noticed a bug where service would have "not" in it's name.
I'm running this on Ubuntu server 16.04, services are run using upstart.
e.g. when regex fails
$ ./check_service.sh -o linux -t "service cplt_marin_push_notifications status"
./check_service.sh: line 250: [: -eq: unary operator expected <<< not sure what this msg means
3 <<< exit code $CRITICAL when *not*running in $STATUS_MSG
cplt_marin_push_notifications start/running, process 30290 <<< $STATUS_MSG
e.g. when regex is ok with different service
$ ./check_service.sh -o linux -t "service cplt_analyzer status"
./check_service.sh: line 250: [: -eq: unary operator expected
6 <<< exit code $OK when *running* in $STATUS_MSG
cplt_analyzer start/running, process 3356 <<< $STATUS_MSG