mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 14:16:00 +00:00
Convert perl script to bash
For a better compatibility
This commit is contained in:
parent
931233d003
commit
60fe9ba9ea
1 changed files with 16 additions and 21 deletions
|
@ -1,23 +1,18 @@
|
||||||
#!/usr/bin/perl
|
#!/bin/bash
|
||||||
#
|
|
||||||
# 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
$succes = `cat /var/log/proftpd/proftpd.log | grep -c "successful"`;
|
if [[ $1 == 'config' ]]; then
|
||||||
$failed = `cat /var/log/proftpd/proftpd.log | grep -c "Login failed"`;
|
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";
|
succes=`cat /var/log/proftpd/proftpd.log | grep -c "successful"`
|
||||||
print "failed.value $failed";
|
failed=`cat /var/log/proftpd/proftpd.log | grep -c "Login failed"`
|
||||||
|
|
||||||
|
echo "succes.value $succes"
|
||||||
|
echo "failed.value $failed"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue