[mrtg] int error
Justin Shore
macdaddy at vinnie.ksu.ksu.edu
Tue Oct 26 07:32:45 MEST 1999
Anyone know what up with that? This is what it return if no one is
connected to the server in question via FTP. I guess I could add 2
if statements that set the value equal to 0 if its null. Problem is
I don't know jack about perl.
Problem with Externale get '`perl /home/www/mrtg/ftpstat.pl`':
Expected an INTEGER for 'in' but got ''
Problem with Externale get '`perl /home/www/mrtg/ftpstat.pl`':
Expected an INTEGER for 'out' but got ''
Here's the perl script:
#!/usr/local/bin/perl
#
# Jon Anhold <jon at snoopy.net>
#
# This code is licensed under the GNU General Public License
#
# License text may be found at: http://www.gnu.org/copyleft/gpl.html
#
@res = `/usr/bin/ftpcount`;
$time = time();
foreach $res (@res) {
if ($res =~ /(\d+)\susers$/) { $users = $1 } else { next }
}
$uptime = `uptime`;
$uptime =~ /up (.*?),/;
$up = $1;
print "$users\n";
print "$users\n";
print "$up\n";
print "vinnie.ksu.ksu.edu\n";
And here's the simple .cfg
WorkDir: /home/httpd/html/stats
Target[ftp]: `perl /home/www/mrtg/ftpstat.pl`
Options[ftp]: growright,gauge
Title[ftp]: vinnie.ksu.ksu.edu ftp users
PageTop[ftp]: <h1>vinnie.ksu.ksu.edu ftp users</h1>
MaxBytes[ftp]: 100
WithPeak[ftp]: dwmy
YLegend[ftp]: No. of users
ShortLegend[ftp]: users
Legend[ftp]: FTP Users:
#LegendI[ftp]:
LegendO[ftp]: FTP Users:
Thanks for an tips I get!
Justin
PS==> How do you kill that god awful crontab e-mail? Its driving me
insane! I'm getting ready to put it on a dummy account and direct it
to /dev/null!
--
* 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