Skip to content

Commit

Permalink
Minor improvements to nagios check
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed May 24, 2024
1 parent 8589d00 commit e1b5a46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/runtime/route-servers/nagios-check-locked-routers.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
exit( 3 );
}

if( $json === "[]" ) {
if( trim($json) === "[]" ) {
echo sprintf( "OK: no routers stuck mid-configuration for >%d seconds\n", $threshold );
exit(0);
}

if( !( $routers = json_decode( $json ) ) ) {
if( !( $routers = json_decode( $json, true ) ) ) {
echo "UNKNOWN: could not decode JSON response from API\n";
exit( 3 );
}
Expand Down

0 comments on commit e1b5a46

Please sign in to comment.