Trends and old data

Marc Powell marc at ena.com
Tue Aug 2 20:04:58 CEST 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of js
> Sent: Tuesday, August 02, 2005 12:46 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Trends and old data
> 
> Hi all,
> 
> I have a host i want to rename.  But i want to keep the historical
data
> of this host,......
> How can I do this?

Ah, yes, this is fun =) It's pretty straight forward but can be tedious.
You need to rename the host in the config files and replace all
occurrences of the name in var/nagios.log and var/archives/*.

You can do this with sed, a perl one-liner such as

cd /usr/local/nagios/var; perl -i.bak -pe 's/oldhost/newhost/e'
nagios.log
cd /usr/local/nagios/var/archives; perl -i.bak -pe 's/oldhost/newhost/e'
nagios*

or a more sophisticated script that only looks at files the host is in,
modifies those and does error checking afterward ;) We opted for this
solution. With almost 3 years of log files and 3 machines to modify them
on it can take up to 10 minutes to rename a single site.

--
Marc


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list