nagios-cvs: Too many open files?

Ethan Galstad nagios at nagios.org
Wed Feb 7 18:30:33 CET 2007


Gerd Mueller wrote:
>> Gerd, the number of temp files is extremely high.  How many Nagios 
>> (child) processes are running when you check the count of temp files? 
>> Something seems to be amiss.  Either that or you're monitoring a ton of 
>> services.18837 pts/0    S+     0:00 grep ssh
> 
> Hm, a lot of them are are critical/down.
>  
> 
> nag01:/root# lsof | grep "/tmp/nagios" | wc -l
> 766
> 
> 
> nag01:/root# lsof | grep "/tmp/nagios" | wc -l
> 774
> 
> 
> nag01:/root# ps ax | grep /usr/local/nagios/bin/nagios
>  4548 ?        Rsl    0:13 /usr/local/nagios/bin/nagios
> -d /usr/local/nagios/etc/nagios.cfg
> 18133 ?        S      0:00 /usr/local/nagios/bin/nagios
> -d /usr/local/nagios/etc/nagios.cfg
> 19028 ?        S      0:00 /usr/local/nagios/bin/nagios
> -d /usr/local/nagios/etc/nagios.cfg
> 19248 ?        S      0:00 /usr/local/nagios/bin/nagios
> -d /usr/local/nagios/etc/nagios.cfg
> 19760 pts/0    S+     0:00 grep /usr/local/nagios/bin/nagios
> 
> 
> nag01:/root# ps ax | grep /usr/local/nagios/bin/nagios -c
> 6
> 
> nag01:/root# lsof | grep "/tmp/nagios" | wc -l
> 5737
> nag01:/root# ps ax | grep libexc -c
> 1
> 
> 
> Gerd
> 


What do you get when you run the following command?

dir /usr/local/nagios/tmp/nagios* | wc -l


LSOF returns entries for files that have already been deleted on my 
system...

nagios     4034   nagios  DEL       REG        3,1             1141972 
/usr/local/nagios/tmp/nagios2e8Q7h


Looks like the kernel must keep references to these files even after 
they've been removed.  This appears to be true based on an article I 
just found:

http://www.linux.com/article.pl?sid=06/10/30/1652211

There's probably a way to tweak the kernel's behavior into immediately 
releasing these files once they've been deleted.  Normally the kernel 
keeps references to deleted files in memory (at least for a while) until 
the process that deleted them exits.

Any kernel gurus out there have a solution to this?


Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Developers mailing list