2014-06-22 14:42:22 +02:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
# -*- perl -*-
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
|
|
|
dar_vpnd a Plugin for displaying VPN Stats for the Darwin (MacOS) vpnd Service.
|
|
|
|
|
|
|
|
=head1 INTERPRETATION
|
|
|
|
|
|
|
|
The Plugin displays the number of active VPN connections.
|
|
|
|
|
|
|
|
=head1 CONFIGURATION
|
|
|
|
|
|
|
|
No Configuration necessary!
|
|
|
|
|
|
|
|
=head1 AUTHOR
|
|
|
|
|
|
|
|
Philipp Haussleiter <philipp@haussleiter.de> (email)
|
|
|
|
|
|
|
|
=head1 LICENSE
|
|
|
|
|
|
|
|
GPLv2
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
|
|
|
# MAIN
|
|
|
|
use warnings;
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
|
|
|
|
my $cmd = "ps -ef | awk '/[p]ppd/ {print substr(\$NF,2);}' | wc -l";
|
|
|
|
|
|
|
|
if ( exists $ARGV[0] and $ARGV[0] eq "config" ) {
|
2017-02-24 03:13:08 +01:00
|
|
|
print "graph_category network\n";
|
2014-06-22 14:42:22 +02:00
|
|
|
print "graph_args --base 1024 -r --lower-limit 0\n";
|
|
|
|
print "graph_title Number of VPN Connections\n";
|
|
|
|
print "graph_vlabel VPN Connections\n";
|
|
|
|
print "graph_info The Graph shows the Number of VPN Connections\n";
|
|
|
|
print "connections.label Number of VPN Connections\n";
|
|
|
|
print "connections.type GAUGE\n";
|
|
|
|
} else {
|
|
|
|
my $output = `$cmd`;
|
|
|
|
print "connections.value $output";
|
2017-02-24 03:13:08 +01:00
|
|
|
}
|