Archive for the ‘Nagios’ Category

if /opt/pnp4nagios/var/spool
is full of files:
service-perfdata.1697462305-PID-78230
host-perfdata.1697455746-PID-72297

and there is huge amount of files in dir, then probably in pnp4nagios perfdata is problem with permissions to dir/files so nagios can’t write performance data to RRD file.

if permissions are resolved – start processing historical performace to RRD files:
/opt/pnp4nagios/libexec/process_perfdata.pl --bulk=service-perfdata.1697462305-PID-78230

for multiple files:
for file in $(ls | head -1000000); do /opt/pnp4nagios/libexec/process_perfdata.pl --bulk="$file"; done

check logs:
tail -f /opt/pnp4nagios/var/perfdata.log

if you have multiple files od RRD (Round Robin Database) files, and want to merge them:

./simple-merge.py old_rrd_file.rrd newer_rrd_file.rrd | rrdtool restore /dev/stdin merged_file.rrd
https://gist.github.com/arantius/2166343#file-simple-rrd-merge-py

to do it faster, with huge amount of multiple files do loop:
for file in $(ls dir1/*.rrd | xargs -n 1 basename | head -1000); do
./simple-merge.py dir1/$file dir2/$file | rrdtool restore /dev/stdin merged/$file; done


file / script:
https://github.com/itsapassion-wordpress-com/check_docker/blob/main/check_docker.sh


screen: