no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | tech:linux:pnp4nagios_averages [2017/01/04 12:25] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== pnp4nagios extracting averages ====== | ||
| + | Extract average for previous month for given server, metric | ||
| + | <code bash> | ||
| + | #!/bin/bash | ||
| + | HN=$1 | ||
| + | DB=$2 | ||
| + | CF=$3 | ||
| + | if [ " | ||
| + | DB=" | ||
| + | fi | ||
| + | rrd1=" | ||
| + | if [ " | ||
| + | CF=" | ||
| + | fi | ||
| + | PERFDATA_DIR=/ | ||
| + | cd $PERFDATA_DIR | ||
| + | # | ||
| + | stime=$(date -d "`date +%Y%m01` -1 month" +%s) | ||
| + | etime=$(date -d "`date +%Y%m01`" | ||
| + | rrdtool fetch $PERFDATA_DIR/ | ||
| + | grep -v nan | \ | ||
| + | awk ' | ||
| + | exit | ||
| + | </ | ||