1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 14:16:00 +00:00

Merge pull request #507 from googley/master

Convert perl script to bash
This commit is contained in:
Steve Schnepp 2014-08-04 17:21:52 +02:00
commit e3cc768b43

View file

@ -1,23 +1,18 @@
#!/usr/bin/perl
#
# By InboX
# Site: www.wolfy.fr
#
if ($ARGV[0] and $ARGV[0] eq "config")
{
print "graph_args --base 1000 -l 0\n";
print "graph_title Serveur FTP\n";
print "graph_category Ftp\n";
print "graph_vlabel Stats Proftpd\n";
print "succes.label Login succes\n";
print "succes.draw AREA\n";
print "failed.label Login failed\n";
print "failed.draw AREA\n";
exit 0;
}
#!/bin/bash
$succes = `cat /var/log/proftpd/proftpd.log | grep -c "successful"`;
$failed = `cat /var/log/proftpd/proftpd.log | grep -c "Login failed"`;
if [[ $1 == 'config' ]]; then
echo "graph_args --base 1000 -l 0"
echo "graph_title Serveur FTP"
echo "graph_category Ftp"
echo "graph_vlabel Stats Proftpd"
echo "succes.label Login succes"
echo "succes.draw AREA"
echo "failed.label Login failed"
echo "failed.draw AREA"
fi
print "succes.value $succes";
print "failed.value $failed";
succes=`cat /var/log/proftpd/proftpd.log | grep -c "successful"`
failed=`cat /var/log/proftpd/proftpd.log | grep -c "Login failed"`
echo "succes.value $succes"
echo "failed.value $failed"