Ping websites from remote host


(Daniel Hood) #1

I’m using OMD to monitor various part of the network. I have a number of remote sites approximately 20 or so, with Cisco routers onsite. Would it be possible to get the OMD server to login to these Cisco Routers via SSH and then run a ping to say Google.com? If so, how would I go about it?

I have tried using a datasource and putting the ssh command with the Cisco routers IP. (https://mathias-kettner.com/checkmk_datasource_programs.html). It’s not working for me though.

Any other way of doing this?


#2

You can add your command to authorized_keys and use datasource programs to get the output and process it with a new check. The command would look like (in $HOME/.ssh/authorized_keys):

command="/sbin/ping -c1 -q $WEBSITE" $SSH-KEY

If the routers can run the agent (probably the Linux or BSD agent), you could also write a cached local check, which would be executed every X minutes/hours/etc. and the result would be automatically in the agent output.
IMHO the second approach is the better and easier one.