[mrtg] Re: script problem

Starkweather, Mike mike.starkweather at anheuser-busch.com
Thu Jul 22 16:40:33 MEST 1999


Robin,

Have you looked at the log file to see if the first line is changing when you
run your script?  The first line should just have three entries:  datestamp,
messages in, messages out.  If you don't see new values in the log then your
script output is not making it that far.

Another thing you can try is to turn on debugging in MRTG.  Look for
"$Main::Debug=0;" a couple of pages into the script and set it to 1.  It should
print the output of any external scripts so you can see what is happening.

Finally, though I have seen some evidence to the contrary, the documentation
calls for a four line input to MRTG:

Line 1 
	current state of the first variable, normally 'incoming bytes count' 
Line 2 
	current state of the second variable, normally 'outgoing bytes count' 
Line 3 
	string (in any human readable format), telling the uptime of the target.

Line 4 
	string, telling the name of the target. 

I usually give a 0 for line 3 and some string for line 4.

Hope some of this helps.

Mike Starkweather
MIS Consultant
314.577.3701
mike.starkweather at anheuser-busch.com


> -----Original Message-----
> From:	Robin Kearney [SMTP:robin at riviera.org.uk]
> Sent:	Thursday, July 22, 1999 8:37 AM
> To:	Glenn Forbes Fleming Larratt
> Cc:	mrtg at list.ee.ethz.ch
> Subject:	[mrtg] Re: script problem
> 
> It ain`t complex :)
> 
> #!/bin/bash
> mailstats -f/var/log/sendmail.st | grep "esmtp" | awk '{print $2"\n"$4"\n\n"}'
> 
> 
> On Thu, Jul 22, 1999 at 08:22:41AM -0500, Glenn Forbes Fleming Larratt wrote:
> > Is Bourne shell your normal shell environment? mrtg has always seemed
> > pretty robust in this respect (kudos Tobi), but I've often found 
> > weirdnesses in my own Perl scripts that were shell-dependent. Can
> > you post mail-stats.sh?
> > 
> > 	-g
> > 
> > On Thu, 22 Jul 1999, Robin Kearney wrote:
> > 
> > > okay I tried:
> > > a) running mrtg from the command line, nothing
> > > b) redirecting stderr, creates and empty file :(
> > > c) making sure everybody can run the script, yes they can.
> > > 
> > > This is what I have in mrtg.cfg:
> > > 
> > > Target[mail]: `/home/httpd/html/mrtg/mail-stats.sh 2>/tmp/mail-stats.err`
> > > MaxBytes[mail]: 150
> > > Options[mail]: gauge
> > > Title[mail]: dent Sendmail Statistics
> > > PageTop[mail]: dent Sendmail Statistics</H1>
> > > WithPeak[mail]: dwmy
> > > YLegend[mail]: No. of messages
> > > ShortLegend[mail]: messages
> > > LegendI[mail]: &nbsp;Incoming:
> > > LegendO[mail]: &nbsp;Outgoing:
> > > 
> > > 
> > > nothing strange or unusual.  the output is at
> http://dent.riviera.org.uk/mrtg/mail.html as you can see nothing :(
> > > 
> > > I thought it might just be a lack of mail, it is a new box, so I ran
> "while (true) ; do ; mail robin at funmail.co.uk < /etc/hosts ; sleep 10 ; done"
> from the cmd line, and watched the output from mail-stats rocket up as
> expected, but still nothing on the 
> > graphs.
> > > 
> > > Anybody have any further ideas?
> > > 
> > > 
> > > 
> > 
> > 
> > --
> > * To unsubscribe from the mrtg mailing list, send a message with the
> >   subject: unsubscribe to mrtg-request at list.ee.ethz.ch
> > * The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg
> 
> --
> * To unsubscribe from the mrtg mailing list, send a message with the
>   subject: unsubscribe to mrtg-request at list.ee.ethz.ch
> * The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg
> 

--
* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg


More information about the mrtg mailing list