Skip to main content

Hello,

We have set up a temperature and humidity check using the new Mosquitto MQTT plugin, and it works well (we receive the value correctly). However, specifying the warning and critical thresholds, whether entered in WARNING or WARNINGREGEXP in the service, is not being taken into account, and the state remains OK.

Has anyone encountered this issue and found a solution?

Thank you in advance,

Hello :)
 

Thanks a lot for the feedback, we've listed an error that seems similar (on the same type of option) on this github issue: https://github.com/centreon/centreon-plugins/issues/5081

Can you confirm that this is a similar issue?

Best regards


Hello,

Thank you for your response. Yes, it seems similar; the only difference is that I am trying to set a specific value, for example, a warning if the temperature is above 22 and critical if it’s above 25, but this appears to be a similar issue.

Best regards,

 


If you can provide us with the command sent and its output (anonymised) that would be great to help us solving this issue. We will do our best to solve the issue as quickly as possible and will keep you informed.

And then, if you agree, we'd like to discuss with you how you use MQTT, as we're very keen to find out more about our users' use cases 🙂 (it can be in private message).

Best regards


Hi,

 

Thank you for your help.

 

We use a raspberry with MQTT with a captor DHT22.

 

This is the script :

 

import time

import Adafruit_DHT

import paho.mqtt.client as mqtt

 

# Configuration du capteur

DHT_SENSOR = Adafruit_DHT.DHT22

DHT_PIN = 4

 

# Configuration du broker MQTT

MQTT_BROKER = "IP"

MQTT_PORT = 1883

MQTT_TOPIC_TEMP = "sparkoh/salle-info/temperature"

MQTT_TOPIC_HUMIDITY = "sparkoh/salle-info/humidite"

 

# Configuration de l'intervalle de temps (en secondes)

INTERVAL = 5

 

# Fonction pour lire le capteur et envoyer les données au broker MQTT

def read_and_send_data():

   humidity, temperature = Adafruit_DHT.read_retry(DHT_SENSOR, DHT_PIN)

   if temperature is not None and humidity is not None:

       temperature = round(temperature, 1)

       humidity = round(humidity, 1)

       print(f"Température: {temperature}°C, Humidité: {humidity}%")

       client.publish(MQTT_TOPIC_TEMP, f"{temperature}")

       client.publish(MQTT_TOPIC_HUMIDITY, f"{humidity}")

   else:

       print("Erreur de lecture du capteur")

 

# Configuration du client MQTT

client = mqtt.Client()

client.connect(MQTT_BROKER, MQTT_PORT, 60)

 

# Boucle principale

try:

   while True:

       read_and_send_data()

       time.sleep(INTERVAL)

except KeyboardInterrupt:

   print("Script interrompu par l'utilisateur.")

finally:

   client.disconnect()

 

 

On Centreon 23.10 we have install the plugin Eclipse Mosquitto MQTT and we use the command associated (below the screenshot). We have also tried with the command numeric value but with this last, we don't see the value in the information of the ckeck

 

 

 

and this is the output of the check :

 

 

 

Tell me if you want more information,

 

Thank you,

 

Regards

 


Thanks a lot 🙏


Hello :)

The November release should provide you with a solution to this issue. Please feel free to confirm that it now works and close this topic.

Best regards


Reply