[mrtg] Re: Problem with a shell script and Mrtg

David Ashbrook dashbrook at dmisi.com
Mon Jun 30 15:58:51 MEST 2003


All the scripts I've used with MRTG print out two lines with 0s on them after
the data.  I'm not sure if it's the correct way of doing it but it works.  You
can check out the "External Monitoring Scripts" section of the reference:

http://people.ee.ethz.ch/~oetiker/webtools/mrtg/reference.html

Hope this helps.

David Ashbrook

-----Original Message-----
From: mrtg-bounce at list.ee.ethz.ch [mailto:mrtg-bounce at list.ee.ethz.ch] On Behalf
Of Godfrey
Sent: Sunday, June 29, 2003 1:59 PM
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] Problem with a shell script and Mrtg

Hello

I would appreciate it if some one could put me right with this

The shell script is as follows

#!/bin/sh

statname="Total Accounts"
uptime=unused

cd /home/full

statfull=$[`ls -l | grep -v ^l | wc -l`]

cd /home/guest

statguests=$[`ls -l | grep -v ^l | wc -l`]

stattotal=$[`expr $statfull+$statguests`]



echo $stattotal
echo $statguests

its output is as follows

[root at miles] ~# /usr/local/etc/mrtg/support/totalmail.sh
80
14
[root at miles] ~#

Which is perfect but when I run mrtg

I get the following

[root at miles] /usr/local/etc/mrtg/support# /usr/local/bin/mrtg 
/usr/local/etc/mrtg/miles.cfg
expr: syntax error
WARNING: Problem with External get '/usr/local/etc/mrtg/support/totalmail.sh':
    Expected a Number for 'in' but got '$[]'

ERROR: Target[miles-user-clients][_IN_] ' $$target[21]{$mode} ' did not 
eval into defined data
WARNING: Skipping Update of miles-user-clients, inlast is not defined
[root at miles] /usr/local/etc/mrtg/support#


The mtrg config is as follows

#
##---------------------------------------------------------------
#
Target[miles-user-clients]: `/usr/local/etc/mrtg/support/totalmail.sh`
Xsize[miles-user-clients]:600
Ysize[miles-user-clients]: 125
Options[miles-user-clients]: gauge,growright,nopercent,noinfo
Title[miles-user-clients]: Number of User Accounts
PageTop[miles-user-clients]: <h1>Number of User Accounts</h1>
MaxBytes[miles-user-clients]: 150
Background[miles-user-clients]: #738AA6
YLegend[miles-user-clients]: # users
ShortLegend[miles-user-clients]: &nbsp;
Legend1[miles-user-clients]: Clients &nbsp;
Legend2[miles-user-clients]: Guest &nbsp;
LegendI[miles-user-clients]: Clients &nbsp;
LegendO[miles-user-clients]: Guest &nbsp;



I would appreciate it if someone could assist me with this please thank you


Kind regards

Godfrey

 From the desk of

Godfrey J. Hamshire
Compu-Doc & Compu-Doc On-Line

Telephone       0314659009
Telefax 0314651998
Cell            083 773 8776

Company's Web Page                      http://compudoc.za.net
Godfrey's Cockatiel Family & Friends    http://cockatiel.za.net
Godfrey's Roses Page                    http://roses.hamshire.za.net
php :- the freedom to breathe

Quote :-Moderation is a fatal thing.
             Nothing succeeds like excess.
              -- Oscar Wilde 

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