nagios spawning second nagios.exe and stops monitoring

4 posts / 0 new
Last post
LaRoche
Offline
Last seen: 7 years 8 months ago
Joined: 04.12.2012 - 15:39
nagios spawning second nagios.exe and stops monitoring

I am Running Nagwin 1.3.0 on Windows 2003 and noticed in the task manager 2 nagios.exe processes. When this happens, nagios stops monitoring because there is no scheduled checks and I am forced to end the process in task manager because it cannot be stopped from the Services control panel.

After stopping the following services, a nagios.exe appears in the task manager and I am forced to end this process before restarting these services for nagwin to start monitoring again.

   Nagwin_Nagios
   Nagwin_Nagiosfcgi
   Nagwin_Nginx
   Nagwin_Phpfcgi

When montioring the task manager after the service restarts, I can see a second nagios.exe get spawned and disappear which corresponds with the check_interval configured in my localhost.cfg.

Is this normal behaviour where nagios.exe spawns a second nagios.exe and has anyone run into this problem where 2 nagios.exe are found in the task manager and forced to do a service restart? There are no errors in the logs showing any problems but again nagios is not monitoring when this happens.

Lanre
Offline
Last seen: 7 years 8 months ago
Joined: 25.02.2013 - 19:04
I'm having this issue too.

I'm having this issue too. Whenever i restart nagwin services, everything seem to work fine for some time... A couple of hours; and alerts come in periodically when they should but then after about 3-4 hours, everything stops and nagwin stops monitoring. Last check time is waaaaay in the past; no alerts also. Task manager reveals two nagios.exe(s) running and i have to kill those processes and restart the service to have thing back to normal again.

This is obviously not normal. Anybody has a fix for this or what might be wrong? The pre-flight checks are OK.

itefix
Offline
Last seen: 16 hours 34 min ago
Joined: 01.05.2008 - 21:33
Please have a look at log

Please have a look at log files in /var/log directory. It should be some entries explaining why it doesn't work for you.

LaRoche
Offline
Last seen: 7 years 8 months ago
Joined: 04.12.2012 - 15:39
I gave up figuring out the

I gave up figuring out the problem and found a workaround to resolve this issue. I created a simple DOS script that is kicked off every hour to monitor nagios and restart it when it see 2 nagios.exe. Here is the DOS script to kill the nagios.exe service and restart it.

 

-------- CheckNagios.bat --------

@echo off
set mypgm=nagios.exe

REM GET date/time stamp
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)

:checkNagios
rem get number of nagios processes
for /f %%i in ('c:\windows\system32\tasklist.exe ^| find /i /c "%mypgm%"') do set /a numProc=%%i

echo Last Check: %mydate%_%mytime%

ECHO # of processes = %numProc%

if %numProc% GTR 1. (goto kill) else goto end

:kill
c:\windows\system32\taskkill.exe /f /IM %mypgm%

REM restart nagios
net start Nagwin_Nagios

REM restart other nagios processes
rem for /f %%x in ('net start ^| findstr /i "nagwin_"') do net stop %%x

:end
echo Exiting program.
echo =================

rem SCHEDULE TASK TO RUN EVERY HOUR and pipe to a logfile
rem SCHTASKS /create /TN "Check Nagios" /TR "c:\icw\bin\checkNagios.bat >> c:\checknagios.log 2>&1" /SC HOURLY /ST 16:00 /MO 1 /RU DOMAIN\USERNAME /RP PASSWORD

REM store last check that will be used by emailNagios.bat using blat.exe
set LAST_NAGIOS_CHECK=%%mydate%%_%%mytime%%