[mrtg] Re: Running mrtg as daemon

Michael Marziani michaelm at kw.com
Tue Feb 12 23:13:58 MET 2002


Try this instead of using rc.local:

[root at testmon etc]# cat /etc/init.d/mrtg
#! /bin/sh

# chkconfig: 345 99 01
# description: Multi Router Traffic Grapher

cd /usr/local/mrtg/bin && ./mrtg --user=mrtg \
      /home/mrtg/cfg/mrtg.cfg  --logging /var/log/mrtg.log &
#EOF

I found this script in the setup docs.  Then I added lines for chkconfig
to make life easier.  Just cut and paste this into a new file in your
init.d and then run "chkconfig --add mrtg".  Run "chkconfig --list mrtg"
to confirm that it set mrtg to run in the appropriate run levels (3, 4
and 5).  "man chkconfig" if confused, or manually link (ln -s) to the
/etc/init.d/mrtg script if you like doing it the hard way.  And of
course don't forget to chmod 755 the file if your umask isn't set
properly.

HTH,

-Mike

_____________________________
Michael D. Marziani
Systems Administrator
Keller Williams Realty International
(512) 327-3070


-----Original Message-----
From: Roscoe [mailto:roscoeman at fuse.net] 
Sent: Tuesday, February 12, 2002 2:27 PM
To: mrtg
Subject: [mrtg] Running mrtg as daemon


ALl:

Running Red Hat 7.1 and have added lines to my /etc/rc.local to fire off
two mrtg cfg's (one for the router, one for the local machine).  

I get a mail message every 5 minutes telling me that mrtg is already
running (it is finding the .pid files in my mrtg config directory.

What is the preferred method of getting mrtg running as daemon.  Yes, I
have RunAsDaemon: Yes with the proper interval in my cfg file.

TIA

Roscoe

--
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