RMA and PING ?

Remote Monitoring Agent for Linux, FreeBSD, and other UNIX-like platforms.
Post Reply
CHRISman
Posts: 2
Joined: Tue Aug 17, 2004 1:11 am
Location: Bulgaria
Contact:

RMA and PING ?

Post 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
KS-Soft
Posts: 12869
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post 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
oakyuz
Posts: 74
Joined: Thu Feb 08, 2007 5:48 am

Post 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
KS-Soft
Posts: 12869
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post 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
oakyuz
Posts: 74
Joined: Thu Feb 08, 2007 5:48 am

Post by oakyuz »

Alex

Thanks for quick and useful response, as always. The code you sent meets my need.

Regards
Oguzhan
Post Reply