cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 7

Exit Code Erors in SolarWinds APM

Ok,

I worte a script to check if a process is running or not.  I ran the script on the box and got an exit code of 0 that being the case solarwinds should report the service as ok  However instead I get the fallowing

Testing on node pbx01: failed with 'Undefined' status

Invalid script return code: 126

 

#!/bin/sh
SERVICE='asterisk'

if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
    echo "$SERVICE service is running everything is FINE!"
    echo $?
else
    echo "$SERVICE is not running"
    echo "$SERVICE is not running!" | mail -s "$SERVICE down" root
    echo $?
fi

 

Anythoughts as to why I would get a exit status of 126 via solarwinds but an exit 0 if I run the script on the box?

0 Kudos
2 Replies
Level 13

Are you using the same user in the Orion APM script credentials that you are using for testing the script on the box? 

0 Kudos

Yes I am using the same user ID with the same creditials

0 Kudos