How to "purge" an old host from the Nagios database

Andreas Ericsson ae at op5.se
Thu May 19 15:31:10 CEST 2005


Arno Lehmann wrote:
> Hi,
> 
> Emmanuel Halbwachs wrote:
> 
>> Hello again,
>>
>>
>> I am experiencing some strange false alarms after reinstalling the
>> OS on a server. I monitor this host, vieuxbleu, with NRPE.
>>
>> On vieuxbleu, running the plugin manually is always OK (tested every
>> 2" for 5' with watch), but on the Nagios host I have some brief false
>> alarm. If I refresh the web page very frequently, the service is
>> mainly OK with a duration of 1d 18h 17m, but sometime the service is
>> shown as CRITICAL with a duration of 2d 18h 59m.
> 
> 
> You probably have more than one nagios processes running. Unfortunately, 
> that happens easily, because on shutdown the process often remains running.
> 
> Check with ps or pstree or top or whatever you prefer.
> 
> If this is the case, shutnagios down normally, wait a little, and issue 
> something like killall -9 nagios.
> 
> Then, you can restart nagios and everything should be fine again.
> 
> And, while nagios is not running...
> 
>> I suspect a mess in the database, so I would like to know if there
>> is a way to "purge" a host in the database. My goal is to start
>> with a clean background before investingating further on.
> 
> 
> ... you simply delete the files from /usr/local/nagios/var (in a 
> standard installation). Note that you probably want to keep the log 
> file, as well as the archives.
> 

A cleaner solution would be to purge only the affected host from the 
logs with something like

mv nagios.log old.nagios.log
sed /hostname/d old.nagios.log > nagios.log

Make sure you get the permissions and ownerships right on nagios.log 
when you're done.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&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