[mrtg] Re: remote monitor of dual cpu's on linux box

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Sun Jul 8 03:52:24 MEST 2001

Chris H wrote:

> Could someone pls provice some kind of script that could allow me to get the remote values of /proc/stat to my mrtg box?

If all else fails, you could think of writing a script on the redhat
box and put this into /etc/inetd.conf 

I don't consider security nor stability here, just as an example:

    666 stream tcp nowait nobody /tmp/test.sh

(Don't use the /tmp directory.)
(Choose an appropriate port on the redhat machine.)

Then write/modify a script that returns the values:

    </proc/stat /bin/awk '
    /cpu /  {
            print $2+$3
            print $2+$3+$4

Now you can use telnet and expect on the monitor machine and feed
the output to mrtg:

    Target[x]: `/your/script`

Maybe netcat will do:

    Target[x]: `/usr/bin/nc linuxhost 666`

 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
| Technical questions sent directly to me will be nuked. Use the list. | 
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |

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