38 lines
724 B
Perl
Executable file
38 lines
724 B
Perl
Executable file
#!/usr/bin/perl -w
|
|
|
|
use strict;
|
|
use Cwd qw(realpath);
|
|
|
|
my $dirname;
|
|
BEGIN
|
|
{
|
|
# We use BEGIN here to calculate the dynamic path BEFORE parsing the "use lib" directive
|
|
my $real = realpath $0 || $0;
|
|
($dirname = $real) =~ s/\/[^\/]*$//;
|
|
}
|
|
# Add our custom path
|
|
use lib "$dirname";
|
|
|
|
use MyRRD;
|
|
|
|
my $rrd = '/var/lib/rrd';
|
|
my $img = '/home/www/www.xwing.info/rrd';
|
|
|
|
my $MyRRD = new MyRRD($rrd, $img);
|
|
|
|
# system
|
|
$MyRRD->cpu();
|
|
$MyRRD->memory(8192, 4096);
|
|
$MyRRD->load();
|
|
$MyRRD->cswitch();
|
|
$MyRRD->iostat('vda');
|
|
|
|
# serveurs
|
|
$MyRRD->nginx('http://127.0.0.1:8080/server-status');
|
|
|
|
# network
|
|
$MyRRD->networkInterface('eth0', 'Réseau');
|
|
$MyRRD->networkInterface('wg0', 'VPN');
|
|
$MyRRD->networkInterface('tun0', 'WKS VPN');
|
|
|