[mrtg] Problem with a shell script and Mrtg
Godfrey
godfrey_lists at compudoc.za.org
Sun Jun 29 20:59:10 MEST 2003
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]:
Legend1[miles-user-clients]: Clients
Legend2[miles-user-clients]: Guest
LegendI[miles-user-clients]: Clients
LegendO[miles-user-clients]: Guest
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
More information about the mrtg
mailing list