KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

RMA and PING ?

 
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX
View previous topic :: View next topic  
Author Message
CHRISman



Joined: 17 Aug 2004
Posts: 2
Location: Bulgaria

PostPosted: Sat Aug 21, 2004 5:15 am    Post subject: RMA and PING ? Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
KS-Soft



Joined: 03 Apr 2002
Posts: 11782
Location: USA

PostPosted: Sat Aug 21, 2004 2:41 pm    Post subject: Reply with quote

Quote:
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:
#!/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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
oakyuz



Joined: 08 Feb 2007
Posts: 54

PostPosted: Wed Jun 22, 2011 12:37 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 11782
Location: USA

PostPosted: Wed Jun 22, 2011 2:28 pm    Post subject: Reply with quote

Scripts can be different depending on version of your ping utility...
You may try this one
Code:

#!/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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
oakyuz



Joined: 08 Feb 2007
Posts: 54

PostPosted: Thu Jun 23, 2011 12:14 am    Post subject: Reply with quote

Alex

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

Regards
Oguzhan
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index