[Fixed] Problem with sensor Flood, Smoke and Power

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
aruggeri
Posts: 8
Joined: Tue Jul 14, 2015 6:27 am

[Fixed] Problem with sensor Flood, Smoke and Power

Post by aruggeri »

Hi guys,

I am new to the forum.
I'm here to ask you a help that is on my monitoring system Nagios, going to monitor the sensor Room Alert or a sensor that detects the temperature of the CED is of rack cabinets that the EDC itself.
So far no problems or if the temperature rises or falls depending on the set values ​​within my /etc/nagios3/conf.d/services_nagios2.cfg system nagios I senganla through web interface and through an e-mail electronic the problem detected.
The problem occurs when I go to test the sensors:
- Flooding
- Smoke
- Power
Such sensors have as a parameter signaling of the error and the value one the value zero.
The problem is that when the state changes from one to zero or vice versa, the system should trigger the alarm but it does not succedo.
I just change the value from one to zero or vice versa on the web interface, the service label monitored stays green and does not receive any notification email.

Thank you to all who will give me advice or help to solve this problem.

Andrea
Attachments
NagiosSensor.jpg
Last edited by aruggeri on Thu Jul 16, 2015 3:44 am, edited 2 times in total.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Problema with sensor Flood, Smoke and Power

Post by jdalrymple »

We need a bit more information.

1) What plugin are you using
2) Share with us your service definition

This is a thresholds problem, but without knowing even what command you're running it's hard for us to know if it's going to interpret thresholds properly.
aruggeri
Posts: 8
Joined: Tue Jul 14, 2015 6:27 am

Re: Problema with sensor Flood, Smoke and Power

Post by aruggeri »

Hi guys,

then the version of nagios used is the following:

root@nagios51:~# dpkg -l | grep nagios
ii nagios-images 0.8 all Collection of images and icons for the nagios system
ii nagios-plugins 1.5-3ubuntu1 all Plugins for nagios compatible monitoring systems (metapackage)
ii nagios-plugins-basic 1.5-3ubuntu1 amd64 Plugins for nagios compatible monitoring systems
ii nagios-plugins-common 1.5-3ubuntu1 amd64 Common files for plugins for nagios compatible monitoring
ii nagios-plugins-standard 1.5-3ubuntu1 amd64 Plugins for nagios compatible monitoring systems
ii nagios3 3.5.1-1ubuntu1 amd64 host/service/network monitoring and management system
ii nagios3-cgi 3.5.1-1ubuntu1 amd64 cgi files for nagios3
ii nagios3-common 3.5.1-1ubuntu1 all support files for nagios3
ii nagios3-core 3.5.1-1ubuntu1 amd64 host/service/network monitoring and management system core files

While the commands used for the monitoring of the sensors of flooding, smoke, and power are the following:

define command {
       command_name check_snmp_flood
       command_line / usr / lib / nagios / plugins / check_snmp -P 1 -H $ HOSTNAME $ -o $ ARG1 $
}

define command {
       command_name check_snmp_smoke
       command_line / usr / lib / nagios / plugins / check_snmp -P 1 -H $ HOSTNAME $ -o $ ARG1 $
}

define command {
       command_name check_snmp_power
       command_line / usr / lib / nagios / plugins / check_snmp -P 1 -H $ HOSTNAME $ -o $ ARG1 $
}

While inside the /etc/nagios3/conf.d/services_nagios2.cfg I defined as follows the structure of the service / s to be monitored:

#Control Sensor Anti-Flooding
define service {
        hostgroup_name flood
        service_description FLOOD
        check_command check_snmp_flood! .1.3.6.1.4.1.20916.1.9.1.5.1.0!
        use generic-service
        }

#Control Sensor Smoke
define service {
        hostgroup_name smoke
        service_description SMOKE
        check_command check_snmp_smoke! .1.3.6.1.4.1.20916.1.9.1.6.1.0!
        use generic-service
        }

#Control Sensor Supply
define service {
        hostgroup_name power
        service_description POWER
        check_command check_snmp_power! .1.3.6.1.4.1.20916.1.9.1.7.1.0!
        use generic-service
        }

As I reported it enough?

Meanwhile thank the help that you are giving me to solve the problem,

Andrea
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Problema with sensor Flood, Smoke and Power

Post by jolson »

Does this work if you try adding the '-c' flag to your commands?

Code: Select all

command_line /usr/lib/nagios/plugins/check_snmp -P 1 -H $ HOSTNAME $ -o $ ARG1 $ -c 1:
Give the above a shot and report back. It is my understanding that adding '-c 1:' will allow for a return code of anything less than one to trigger critically.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
aruggeri
Posts: 8
Joined: Tue Jul 14, 2015 6:27 am

Re: Problema with sensor Flood, Smoke and Power

Post by aruggeri »

Hi guys,

first of all I wanted to thank you because, I was able to operate the monitoring service of the sensors:
Anti-flooding
Anti-smoking
Power
The changes I made to the file /etc/nagios3/commands.cfg are as follows:

define command {
       command_name check_snmp_flood_ced01
       command_line / usr / lib / nagios / plugins / check_snmp -P 1 -H $HOSTNAME$ -o $ARG1$ -c $ARG2$
}

define command {
       command_name check_snmp_smoke_ced01
       command_line / usr / lib / nagios / plugins / check_snmp -P 1 -H $HOSTNAME$ -o $ARG1$ -c $ARG2$
}

define command {
       command_name check_snmp_power_ced01
       command_line / usr / lib / nagios / plugins / check_snmp -P 1 -H $HOSTNAME$ -o $ARG1$ -c $ARG2$
}

While inside the /etc/nagios3/conf.d/services_nagios2.cfg I made the following changes:

#Control Sensor Anti-Flooding CED01
define service {
        hostgroup_name flood_ced01
        service_description FLOOD_CED01
        check_command check_snmp_flood_ced01! .1.3.6.1.4.1.20916.1.9.1.5.1.0! 1: 1
        use generic-service
        }

#Control Sensor Smoke CED01
define service {
        hostgroup_name smoke_ced01
        service_description SMOKE_CED01
        check_command check_snmp_smoke_ced01! .1.3.6.1.4.1.20916.1.9.1.6.1.0! 0: 0
        use generic-service
        }

#Control Sensor Power CED01
define service {
        hostgroup_name power_ced01
        service_description POWER_CED01
        check_command check_snmp_power_ced01! .1.3.6.1.4.1.20916.1.9.1.7.1.0! 1: 1
        use generic-service
        }

Changes made work and give me the possibility to receive emails or when the service takes a critical state that when he returns to normal.
Do you think the following changes can be corrected so as I descrittie?
If you can put the state "Fixed" to the message?

Thanks a lot,

Andrea
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Problem with sensor Flood, Smoke and Power

Post by jolson »

If you can put the state "Fixed" to the message?
Are you saying that the issue has been resolved? If so, I would be happy to close the thread. Thanks!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked