Page 4 of 5

Re: Nagios Host Configuration Options

Posted: Tue Jan 29, 2013 9:52 am
by chris2ferz
nagios1.png
nagios2.png
nagios3.png
In case it helps I have posted screenshots of the config to see if maybe something is wrong. Would really like to get this working since I have alot of time into it and it seems to be the only thing missing. The 3rd pic shows a host that has been offline for over a day but still shows as up.

Re: Nagios Host Configuration Options

Posted: Tue Jan 29, 2013 1:39 pm
by slansing
Yes you are correct it is in seconds, so 21600 would in fact be 6 hours and 300 would be5 minutes. In relation to the Arcade-PC host which appears to not have freshness checking functioning on can you verify through the Core Config Manager that on it's Host/Service Management page the template set under Manage Templates has the new passive "freshness check" template assigned? And that you clicked Save and Apply Configuration? Just making sure that it got written, out of curiosity, what other templates are under it's Manage Templates page?

Re: Nagios Host Configuration Options

Posted: Tue Jan 29, 2013 1:52 pm
by chris2ferz
I checked under CCM>hosts>common settings>manage templates and it has just one assigned template and its xiwizard_passive_host. There appears to be many others to chose from but I didn't see one that said freshness check so is it the one I modified that should be assigned to it?

I checked under the template config where I made the changes you suggested and they are still there and already saved and applied. Hope this makes sense. Please let me know what I should try next or if you need any info. Thanks a bunch

Re: Nagios Host Configuration Options

Posted: Tue Jan 29, 2013 5:28 pm
by slansing
Can you upload your latest config snapshot? If you do not want it on the open forum you can PM it to either swilkerson or myself, in the PM make sure you link this thread. You can download the snapshot from Admin > Config Snapshots > Click the diskette icon next to the latest file. Thanks!

Re: Nagios Host Configuration Options

Posted: Tue Jan 29, 2013 6:07 pm
by chris2ferz
sent a PM to both with the config you asked for. Thanks
I hope it will finally lead to an answer to this puzzle.

Re: Nagios Host Configuration Options

Posted: Wed Jan 30, 2013 12:41 pm
by slansing
Looking over the configuration files as I type, have you noticed anything different today? Could you snap another screen shot of the host list?

Re: Nagios Host Configuration Options

Posted: Wed Jan 30, 2013 12:50 pm
by chris2ferz
No change. The passive host at the top which has been offline for over 2 days still shows as up. Here is the screenshot. Let me know if you need anything else. Thanks for having a look
nagios4.png

Re: Nagios Host Configuration Options

Posted: Wed Jan 30, 2013 1:11 pm
by tonyyarusso
chris2ferz wrote:1- Is there anyway for Nagios to know if a computer was rebooted or shutdown vs a locked or crashed system? It would be offline either way but one would be intended. This way a false notification would not be sent.
I can't speak to the case of Windows or OS X hosts, but for Linux and BSD the answer is yes. What you would want to do is create a SysVInit, Upstart, or other appropriate init script for your system, which would send a command to Nagios scheduling planned downtime for the host. Then set that script to be included in the clean shutdown sequence (runlevel 6 on Ubuntu at least). You will of course need to have Nagios configured to accept external commands for this to work.

Re: Nagios Host Configuration Options

Posted: Wed Jan 30, 2013 1:24 pm
by chris2ferz
thanks for that - it may come in very handy. i could maybe create a .vbs script that would do that in a windows environment

Re: Nagios Host Configuration Options

Posted: Wed Jan 30, 2013 2:24 pm
by scottwilkerson
Can you post the output of the following

Code: Select all

cat /usr/local/nagios/etc/nagios.cfg|grep freshness
if you don't have

Code: Select all

check_host_freshness=1
check_service_freshness=1
we will need to edit these in the /usr/local/nagios/etc/nagios.cfg and restart nagios

Code: Select all

service nagios restart
for the case of detecting a Windows system reboot, here is a solution to send a notification when a server has an uptime of less than a certain amount of time when Nagios performs the check.

If we go into the CCM -> Commands and Add new command
Command Name = xi_negate_check_nt
Command Line = $USER1$/negate $USER1$/check_nt -H $HOSTADDRESS$ -s "$ARG1$" -p 12489 -v $ARG2$ $ARG3$ $ARG4$
Command Type = check command
Save

Then, create a service for the host using normal templating and selecting the host
Change the Check command to xi_negate_check_nt
Set
$ARG1$ = <NSCLIENT_PASSWORD>
$ARG2$ = COUNTER
$ARG3$ = -l "\\System\\System Up Time","Uptime: %.f seconds" -c 300
Save

Apply Configuration

This will set this service to critical if the server has been up for less than 300 seconds