Created
November 17, 2015 14:38
-
-
Save 7171u/5a2c310b81e225ee21c9 to your computer and use it in GitHub Desktop.
pnp4nagios last update error (No recent data in graph).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Author:Anon | |
#Run against all .rrd files inside /usr/local/pnp4nagios/var/perfdata/ | |
for file in $(find /usr/local/pnp4nagios/var/perfdata/ -name "*.rrd"); do | |
rrdtool dump "$file" | perl -ne 'BEGIN {$t=`date +%s`; chomp($t);} $a=$_; if ($a =~ /lastupdate.\d+..lastupdate/) { $a =~ s/(lastupdate.)\d+(..lastupdate)/$1$t$2/; } print $a' | rrdtool restore -f - "$file" | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment