[mrtg] Re: int error

Mohammed, Hadiza L hadiza.l.mohammed at lmco.com
Wed Oct 27 16:21:12 MEST 1999


Remove the word perl from your Target in the configuration file. As long as
you can run the perl script from the Unix prompt by typing ftpstat.pl, you
should be good to go with a Target: `/home/www/mrtg/ftpstat.pl`. However, if
the script is looking for an input, then the target should be
`/home/www/mrtg/ftpstat.pl input1 input2`.

-----Original Message-----
From: Justin Shore [mailto:macdaddy at vinnie.ksu.ksu.edu]
Sent: Tuesday, October 26, 1999 1:33 AM
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] int error


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]: &nbsp;FTP Users:
#LegendI[ftp]:
LegendO[ftp]: &nbsp;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

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