Page 1 of 1
RMA and PING ?
Posted: Sat Aug 21, 2004 5:15 am
by CHRISman
Hello , I've installed RMA for linux and one for Windows...
Why windows RMA have much more test to perform than Linux...
And the most important is why PING test does not work in Linux ?
I've enabled it , and tryed to reconfigure the RMA form remote manager, but there is no PING option to switch on/off... why ???
Thank you in advance
Posted: Sat Aug 21, 2004 2:41 pm
by KS-Soft
Why windows RMA have much more test to perform than Linux...
And the most important is why PING test does not work in Linux ?
Because its very easy to implement custom checks on UNIX using scripts. RMA for UNIX supports Shell Script test method, HostMonitor has about 15 preconfigured scripts for this method.
For example simple ping script may look like
Code: Select all
#!/bin/sh
ping -c $2 -w $3 $1 1> /dev/null 2> /dev/null
if [ $? -eq 0 ]
then
echo "ScriptRes:Host is alive:"
else
echo "ScriptRes:No answer:"
fi
It has 3 parameters: <host> <retries> <timeout>
Regards
Alex
Posted: Wed Jun 22, 2011 12:37 am
by oakyuz
Hi Alex
I used this script and worked. However, it does not return any reply, i.e., the time for ping operation in ms, for example. It just says "Host is alive" or "No answer". This would be useful for us when analyzing the network by looking at ping time. How can I modify this script to return ping time?
Thanks,
Oguzhan
Posted: Wed Jun 22, 2011 2:28 pm
by KS-Soft
Scripts can be different depending on version of your ping utility...
You may try this one
Code: Select all
#!/bin/sh
png=$(ping -c $2 -w $3 $1 | grep 'min/avg/max' | awk -F'/' '{ print $5}'|awk '{print int($1+0.5)}')
if [ "$png" = "" ]
then
echo "ScriptRes:No answer:"
else
echo "ScriptRes:Host is alive:"$png" ms"
fi
Regards
Alex
Posted: Thu Jun 23, 2011 12:14 am
by oakyuz
Alex
Thanks for quick and useful response, as always. The code you sent meets my need.
Regards
Oguzhan