diff --git a/doc/Extensions/Applications.md b/doc/Extensions/Applications.md index 01ba7b3b19..5476eba2b4 100644 --- a/doc/Extensions/Applications.md +++ b/doc/Extensions/Applications.md @@ -87,6 +87,7 @@ by following the steps under the `SNMP Extend` heading. 1. [Apache](#apache) - SNMP extend, Agent 1. [Asterisk](#asterisk) - SNMP extend +1. [backupninja](#backupninja) - SNMP extend 1. [BIND9/named](#bind9-aka-named) - SNMP extend, Agent 1. [Certificate](#certificate) - Certificate extend 1. [C.H.I.P.](#chip) - SNMP extend @@ -233,6 +234,28 @@ The application should be auto-discovered as described at the top of the page. If it is not, please follow the steps set out under `SNMP Extend` heading top of page. +# backupninja + +A small shell script that reports status of last backupninja backup. + +## SNMP Extend + +1: Download the [backupninja +script](https://github.com/librenms/librenms-agent/blob/master/snmp/backupninja.py) +to `/etc/snmp/backupninja.py` on your backuped server. +``` +wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/backupninja.py -O /etc/snmp/backupninja.py` +``` +2: Make the script executable: `chmod +x /etc/snmp/backupninja.py` +3: Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf`) and add: + +``` +extend backupninja /etc/snmp/backupninja.py +``` + +4: Restart snmpd on your host + + # BIND9 aka named 1: Create stats file with appropriate permissions: diff --git a/includes/html/graphs/application/backupninja_backupninja.inc.php b/includes/html/graphs/application/backupninja_backupninja.inc.php new file mode 100644 index 0000000000..c9fcbe98ae --- /dev/null +++ b/includes/html/graphs/application/backupninja_backupninja.inc.php @@ -0,0 +1,43 @@ + array( + 'descr' => 'last_actions', + 'colour' => '22FF22', + ), + 'last_fatal' => array( + 'descr' => 'last_fatal', + 'colour' => '0022FF', + ), + 'last_error' => array( + 'descr' => 'last_error', + 'colour' => 'FF0000', + ), + 'last_warning' => array( + 'descr' => 'last_warning', + 'colour' => '0080C0', + ), + ); + +$i = 0; +if (rrdtool_check_rrd_exists($rrd_filename)) { + foreach ($array as $ds => $var) { + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $var['descr']; + $rrd_list[$i]['ds'] = $ds; + // $rrd_list[$i]['colour'] = $var['colour']; + $i++; + } +} else { + echo "file missing: $file"; +} + +$colours = 'mixed'; +$nototal = 1; +$unit_text = 'backups'; + +require 'includes/html/graphs/generic_multi_line.inc.php'; diff --git a/includes/html/pages/apps.inc.php b/includes/html/pages/apps.inc.php index 36d6e497da..fbac975199 100644 --- a/includes/html/pages/apps.inc.php +++ b/includes/html/pages/apps.inc.php @@ -332,6 +332,10 @@ $graphs['mailcow-postfix'] = array( 'traffic', 'domains', ); +$graphs['backupninja'] = array( + 'backupninja', +); + echo '