[mrtg] Re: mrtg and remote scripts for linux.....

Bradford Woodcock bwoodcoc at Genuity.com
Tue Sep 12 15:28:07 MEST 2000


Hi Jelle,

I'm not sure if this is a possibility for you or not, but it is an idea. I
built a distributed ping monitor in which the technique may work for you.
The pings are executed remotely via a script on each remote system. I
installed apache on the remote servers so you will need to have each system
as a small web server, if that is possible. mrtg is set up to execute a
LOCAL script with the params being the address of the system to execute the
ping from and the address to ping:

Example, 1.1.1.1:5001 is the web server and port, 2.2.2.2 is the address to
ping:

Target[foo]: `webPing.pl 1.1.1.1:5001 2.2.2.2` 

webPing.pl is a very simple script which builds a url from the variables
and calls a remote cgi (simple but cool). The remote cgi executes the ping
and formats this into the 4 lines for mrtg. Here is all there is to
webPing.pl below.

cheers,
brad...

#/usr/local/bin/perl
#
#
$url = "http://$ARGV[0]/nmsbin/webPing/webPing.cgi?Target=$ARGV[1]";
use LWP::Simple;
getprint($url);
exit;



At 03:01 PM 9/12/2000 +0200, Jelle Beusen wrote:
>Hi everyone.....
>
>Ok the following is what I wanne do...
>
>I have mrtg 2.8.....
>
>I have 2 freesco boxes and some linux and nt servers total is 8 and one
isdn4linux router...
>
>Now I have no snmp on most of these boxes....and am not able to put it on
there either for various reasons...
>
>So I was looking at the possibility for scripts that run and get the
stats...well I have a local version just fine and it does what I wanat now
I want it to collect from atleatst my freesco and my regular linux boxes
the stats but I can not seem to figure out how to do this....
>
>Now freesco has a limited command set so awk and such don't work ...it
does fo all my other boxes...
>
>I am stuck now as I have no rsh or what ever anybody ideas on how to get
this to work maybe someone has it and wants to share the script....
>
>at this time I get the stats for the local linux box where mrtg is running
on by ding netstat -i | awk etc etc etc....
>
>I have this for my target and I know I would need a script of some form to
get this to go on remote systems but for my life I can not figure out how ....
>
>PLEASE I NEED HELP ;-)
>
>--
>Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
>Archive     http://www.ee.ethz.ch/~slist/mrtg
>FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
>WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
>

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list