an extra level.
···
–
Phil Randal
Infrastructure Engineer
Hoople Ltd | Thorn Office Centre | Hereford | HR2 6JT
Tel : 01432 260415 |Email:
phil.randal@hoopleltd.co.uk
General email:
enquiries@hoopleltd.co.uk
Website: www.hoopleltd.co.uk
From: Randal, Phil
Sent: 17 August 2015 16:20
To: ‘Marcel Schulte’; checkmk-en@lists.mathias-kettner.de; omd-users@lists.mathias-kettner.de
Subject: RE: [Check_mk (english)] Perfdata cleanup
I had to add
old_files = {}
at around line 197 at the start of process_host, otherwise deleting a host which no longer exists creates an exception.
Cheers,
Phil
–
Phil Randal
Infrastructure Engineer
Hoople Ltd | Thorn Office Centre | Hereford | HR2 6JT
Tel : 01432 260415 |Email:
phil.randal@hoopleltd.co.uk
General email:
enquiries@hoopleltd.co.uk
Website: www.hoopleltd.co.uk
From:
checkmk-en-bounces@lists.mathias-kettner.de [mailto:checkmk-en-bounces@lists.mathias-kettner.de]
On Behalf Of Marcel Schulte
Sent: 17 August 2015 15:26
To: checkmk-en@lists.mathias-kettner.de;
omd-users@lists.mathias-kettner.de
Subject: Re: [Check_mk (english)] Perfdata cleanup
Hi guys (and girls, if any),
I finished my cronjob script to cleanup perfdata files.
The script is intended to be run as OMD siteuser - but will complain about which variables to tweak if it’s not 
If you’re not using CMC (“Check_MK Micro Core”) you must set line 48 to False
Here’s the usage:
$cleanup_perfdata.py -h
usage: cleanup_perfdata.py [-h] [-x XDAYS] [-n] [-N] [-v] [-V]
cleanup_perfdata: remove perfdata files not needed anymore
optional arguments:
-h, --help show this help message and exit
-x XDAYS, --xdays XDAYS
set fileage in days [default: 90]
-n, --dryrun do not delete anything, just report [default: False]
-N ‘dryrun’ but non-verbose, just stats [default: False]
-v, --verbose set verbosity level [default: False]
-V, --version show program’s version number and exit
Dryrun (“-n|–dryrun”) implies “-v|–verbose”.
Try different XDAYS with dryrun to get a clue what’s going on 
Comments are very much appreciated.
https://github.com/dasmarci/check_mk/blob/master/scripts/cleanup_perfdata.py
Regards,
Marcel
Jeffrey J. Gerschkow jgerschk@comcast.net schrieb am Sa., 15. Aug. 2015 um 14:37 Uhr:
What I have used and modify is this.
https://github.com/lingej/pnp4nagios/blob/master/scripts/check_pnp_rrds.pl.in
Might be worth something to some.
Not only can you add this as a check (classic Nagios/icinga), but there is a command
line options –deletexml –deleterrd that can be used to help in cleanup. The script itself, when using those you have to hit Y to delete for each, but easily modified if you want to add it to a cron job to delete.
Just another suggestion for aiding in cleanup.
From:
checkmk-en-bounces@lists.mathias-kettner.de [mailto:checkmk-en-bounces@lists.mathias-kettner.de]
On Behalf Of paulmonitoring
Sent: Friday, August 14, 2015 5:45 PM
To: Marcel Schulte schulte.marcel@gmail.com; Andreas Döhler andreas.doehler@gmail.com; Gerardo Ferreyra <raptorg83@gmail.com >;
checkmk-en@lists.mathias-kettner.de checkmk-en@lists.mathias-kettner.de;
omd-users@lists.mathias-kettner.de
Subject: Re: [Check_mk (english)] Perfdata cleanup
I’m interested.
-------- Original message --------
From: Marcel Schulte schulte.marcel@gmail.com
Date: 08/14/2015 16:38 (GMT-05:00)
To: paulmonitoring paulmonitoring@gmail.com, Andreas Döhler andreas.doehler@gmail.com, Gerardo Ferreyra <raptorg83@gmail.com >,
“checkmk-en@lists.mathias-kettner.de” checkmk-en@lists.mathias-kettner.de,
omd-users@lists.mathias-kettner.de
Subject: Re: [Check_mk (english)] Perfdata cleanup
Hi,
I’m currently working on a weekly cronjob doing the cleanup for me.
What’s already working:
- Find data of deleted hosts and remove the whole host folder from perfect.
- Find all remaining files with modification time older than a configurable amount of days (defaults to 90) and remove them.
The latter will be rewritten to only remove the file if it’s known not to be needed anymore. I think this will be usable mid of next week, there’s more important work to do first 
Whole thing is written in python and works inside OMD sites without modifications. For non-OMD installations a single variable must be changed.
…I could post the mentioned working part at Monday if anyone is interested.
Best regards,
Marcel
paulmonitoring paulmonitoring@gmail.com schrieb am Fr., 14. Aug. 2015 22:24:
I echo what Andreas says. Be cautious. In the past I may or may not have deleted a lot of data by accident from the perfdata dir. 
Sent via the Samsung GALAXY S® 5, an AT&T 4G LTE smartphone
-------- Original message --------
From: Andreas Döhler andreas.doehler@gmail.com
Date: 08/14/2015 15:32 (GMT-05:00)
To: Gerardo Ferreyra raptorg83@gmail.com, “checkmk-en@lists.mathias-kettner.de” checkmk-en@lists.mathias-kettner.de,
omd-users@lists.mathias-kettner.de
Subject: Re: [Check_mk (english)] Perfdata cleanup
Yes and no.
Perfdata directory will only get bigger with new hosts in the moment you create one host the total space is allocated. What I do on my systems is from time to time a find with older then 30-60 days on this directory. With this I remove obsolete perfdata from
deleted machines on non existent checks.
But pay attention what you delete there 
Best regards
Andreas
Gerardo Ferreyra raptorg83@gmail.com schrieb am Fr., 14. Aug. 2015 21:19:
Hi guys.
A quick one. I have hundreds of servers being monitored by check_mk.
I’m seeing that perfdata directory is getting very big.
/opt/omd/sites/prod/var/pnp4nagios/perfdata
I need performance data, of course.
My question.
I have no problem (for now) to increase the disk, but… is there a internal functionality on check_mk (wato) I need to activate, that rotates this data? Set
to… retain X months of data? Something like that?
I see “Diskspace cleanup” on global settings. Is that?
Thank you very much!
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
We’ll meet in Munich for the 2nd Check_MK Conference!
Book your place now and be part of it.
October 18th-20th, 2015
http://mathias-kettner.com/conference
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
We’ll meet in Munich for the 2nd Check_MK Conference!
Book your place now and be part of it.
October 18th-20th, 2015
http://mathias-kettner.com/conference