Hey everyone. I'm currently attempting to band-aid an horrible use of a Cacti implementation (and I swear, this is only temporary! No, really! They told me it's in the budget for next year, and has already been approved... I hope...) Anyway... I am using rrdtool to dump the data into an xml file.
So this xml file is going to have several hundred (possibly thousand) lines that consist of:
<some tag I'm forgetting> <some other tag> datestamp </some other tag> <v> (either NaN or 0.0000000000000000000000e1)</v> </some tag I'm forgetting>
I apologize for my wonderfully specific detail in there, but I had a systems crash last night, which means I can't ssh into the cacti box (I forgot the IP :( ), or pull up the xml or rrd files I had on my local computer - sorry!.
My goal is to do two things - make sure the date is within a week of the date parsed (this is going to be in cron), and increment either of two counters (one for NaN, one for the .0000whatever). There are approximately 300 hosts/rrd files that I have to do this for, I believe the rrd files contain data from the last month, so there's a good portion of the data I will be dropping, and I was wondering if there was an "easy" language in which to do the date comparison/incrementing. Right now it's all in shell, but that is just as a proof of concept for management, I haven't tried to parse through that xml file or read all the hostnames from the other cacti database yet, it seems like sed or awk might be more convenient, or should I just try to do the whole thing in python or perl or something?
Any input is appreciated.