mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-08-11 16:34:34 +00:00
Whitespace cleanup
* remove trailing whitespace * remove empty lines at the end of files
This commit is contained in:
parent
ef851f0c34
commit
17f784270a
604 changed files with 2927 additions and 2945 deletions
|
@ -4,7 +4,7 @@
|
|||
# Multigraph munin plugin to monitor Ubiquiti AirOS devices various parameters. It needs
|
||||
# Perl's Net::Telnet or Net::OpenSSH to be able to connect.
|
||||
#
|
||||
# To use this plugin, copy it to the munin's plugin directory (eg. /usr/share/munin/plugins)
|
||||
# To use this plugin, copy it to the munin's plugin directory (eg. /usr/share/munin/plugins)
|
||||
# under the name "ubiquiti_airos_". Don't change this filename! Follow these steps:
|
||||
#
|
||||
# 1. Give names to your devices, in fqdn style. Like "apo.wlan" or "cli.wlan". To make the
|
||||
|
@ -53,12 +53,12 @@
|
|||
#
|
||||
# 5. Restart the munin node by 'service munin-node restart'.
|
||||
#
|
||||
# If all went well, after 5 minutes or so you should have two additional nodes listed
|
||||
# If all went well, after 5 minutes or so you should have two additional nodes listed
|
||||
# on the Web Interface of munin.
|
||||
#
|
||||
# To use the script with public keys authentication and no password, set env.NetMode SSHkey, and
|
||||
# create a pair of keys using command 'sudo ssh-keygen -t rsa'. This will generate in /root/.ssh
|
||||
# directory two files, id_rsa and id_rsa.pub. Upload id_rsa.pub to your Ubiquiti device using
|
||||
# To use the script with public keys authentication and no password, set env.NetMode SSHkey, and
|
||||
# create a pair of keys using command 'sudo ssh-keygen -t rsa'. This will generate in /root/.ssh
|
||||
# directory two files, id_rsa and id_rsa.pub. Upload id_rsa.pub to your Ubiquiti device using
|
||||
# Services > SSH Server > Authorized Keys window. Try to log in to the device by command line
|
||||
# first ('sudo ssh foobar@cli.wlan'), to save the RSA key fingerprint in the root account.
|
||||
#
|
||||
|
@ -89,7 +89,7 @@ use warnings;
|
|||
my $NetMode = $ENV{'NetMode'};
|
||||
if ($NetMode =~ /Telnet/) {
|
||||
use Net::Telnet;
|
||||
}
|
||||
}
|
||||
elsif ($NetMode =~ /SSH/) {
|
||||
use Net::OpenSSH;
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ chomp ($HostLo);
|
|||
##############################################################################
|
||||
## Define variables
|
||||
my $graph_period = "second";
|
||||
my ($load, $uptime, $ping_time, $packet_loss, $amc, $amq, $conn, $mt, $mf, $mb, $errlrcvd, $errltrans, $errwrcvd, $errwtrans, $ping_timelo, $packet_losslo);
|
||||
my ($load, $uptime, $ping_time, $packet_loss, $amc, $amq, $conn, $mt, $mf, $mb, $errlrcvd, $errltrans, $errwrcvd, $errwtrans, $ping_timelo, $packet_losslo);
|
||||
my ($trflup, $trfldown, $trfwup, $trfwdown, $freq, $txccq, $acttimeout, $txsignal, $noisefloor, $txrate, $rxrate, $errnwid);
|
||||
my ($errcrypt, $errfrag, $errretries, $errbmiss, $errother, $cpuuser, $cpusystem, $cpunice, $cpuidle, $cpuiowait, $cpuirq, $cpusoftirq);
|
||||
$load = $uptime = $ping_time = $packet_loss = $amc = $amq = $conn = $mt = $mf = $mb = $errlrcvd = $errltrans = $errwrcvd = $errwtrans = $ping_timelo = $packet_losslo = "U";
|
||||
|
@ -454,20 +454,20 @@ if ($NetMode =~ /Telnet/) {
|
|||
|
||||
elsif ($NetMode =~ /SSHPass/) {
|
||||
## Initiate SSH Session using password authentication
|
||||
$SSH = Net::OpenSSH->new($Hostname,
|
||||
$SSH = Net::OpenSSH->new($Hostname,
|
||||
port => $Port,
|
||||
user => $User,
|
||||
user => $User,
|
||||
password => $Pass,
|
||||
timeout => 10,
|
||||
# master_stderr_discard => 1,
|
||||
master_opts => [-o => "StrictHostKeyChecking=no"]);
|
||||
$SSH->error and
|
||||
$SSH->error and
|
||||
# warn "Couldn't establish SSH connection: " . $SSH->error;
|
||||
&printResults(); # Nothing happens, except printing undefined results to munin
|
||||
}
|
||||
|
||||
elsif ($NetMode =~ /SSHKey/) {
|
||||
## Initiate SSH Session using public key authentication
|
||||
## Initiate SSH Session using public key authentication
|
||||
$SSH = Net::OpenSSH->new($Hostname,
|
||||
port => $Port,
|
||||
user => $User,
|
||||
|
@ -666,8 +666,8 @@ my $pinglo = join(" ", @pinglo);
|
|||
$ping_timelo = ($1 / 1000) if ($pinglo =~ m@min/avg/max.*\s\d+(?:\.\d+)?/(\d+(?:\.\d+)?)/\d+(?:\.\d+)?@);
|
||||
$packet_losslo = $1 if ($pinglo =~ /(\d+)% packet loss/);
|
||||
|
||||
chomp($load, $uptime, $ping_time, $packet_loss, $amc, $amq, $conn, $mt, $mf, $mb, $errlrcvd, $errltrans, $ping_timelo, $packet_losslo,
|
||||
$errwrcvd, $errwtrans, $trflup, $trfldown, $trfwup, $trfwdown, $freq, $txccq, $acttimeout, $txsignal,
|
||||
chomp($load, $uptime, $ping_time, $packet_loss, $amc, $amq, $conn, $mt, $mf, $mb, $errlrcvd, $errltrans, $ping_timelo, $packet_losslo,
|
||||
$errwrcvd, $errwtrans, $trflup, $trfldown, $trfwup, $trfwdown, $freq, $txccq, $acttimeout, $txsignal,
|
||||
$noisefloor, $txrate, $rxrate, $errnwid, $errcrypt, $errfrag, $errretries, $errbmiss, $errother,
|
||||
$cpuuser, $cpusystem, $cpunice, $cpuidle, $cpuiowait, $cpuirq, $cpusoftirq);
|
||||
|
||||
|
@ -688,7 +688,7 @@ sub printResults {
|
|||
print "multigraph airos_ack\n";
|
||||
print "acttimeout.value " . $acttimeout . "\n";
|
||||
print "\n";
|
||||
|
||||
|
||||
print "multigraph airos_dbm\n";
|
||||
print "txsignal.value " . $txsignal . "\n";
|
||||
print "noisefloor.value " . $noisefloor . "\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue