Linux external SSH Shell Script check help
Posted: Thu Nov 10, 2011 11:16 pm
Hi,
I need some help using the External - SSH – “Shell Script Result” – check aginst Linux boxes.
I’ve been trying to figure out the syntax /scripting structure for this test but so far have not had much luck.
The most I’ve been able to get to work is abc=ls; echo ScriptRes:'Ok':$abc and this just echos ls for the result.
Do you have any examples for this?
Like something for a simple memory check that looks up the current free memory, compares that against a hardcoded value, shows Ok or Bad depending on if the free mem is greater or less than the min and then also displays the current free memory in the reply output, like the below:
op = cat /proc/meminfo | awk '$1=="MemFree:"{print $2;exit}'
if op > 3000 then
ScriptRes:'Ok':$op
Else
ScriptRes:'Bad':$op
fi
Also with in the External – SSH test – Text Output -- check, I have successfully run a script on the remote box by doing ./script but I do not see any results from this test show up in the reply.
Is there a way to tune up the reply so to show its output?
Thanks for the help
I need some help using the External - SSH – “Shell Script Result” – check aginst Linux boxes.
I’ve been trying to figure out the syntax /scripting structure for this test but so far have not had much luck.
The most I’ve been able to get to work is abc=ls; echo ScriptRes:'Ok':$abc and this just echos ls for the result.
Do you have any examples for this?
Like something for a simple memory check that looks up the current free memory, compares that against a hardcoded value, shows Ok or Bad depending on if the free mem is greater or less than the min and then also displays the current free memory in the reply output, like the below:
op = cat /proc/meminfo | awk '$1=="MemFree:"{print $2;exit}'
if op > 3000 then
ScriptRes:'Ok':$op
Else
ScriptRes:'Bad':$op
fi
Also with in the External – SSH test – Text Output -- check, I have successfully run a script on the remote box by doing ./script but I do not see any results from this test show up in the reply.
Is there a way to tune up the reply so to show its output?
Thanks for the help