luca219 Geschrieben August 5, 2015 at 08:06 Geschrieben August 5, 2015 at 08:06 hi all, i need monitor server room with nagios and briklets. I followed this wiki for temperature http://www.tinkerunity.org/wiki/index.php/EN/Projects/IT_Infrastructure_Monitoring_-_Nagios_Plugin and I followed base code http://www.tinkerforge.com/en/doc/Software/Bricklets/MotionDetector_Bricklet_Python.html#motion-detector-bricklet-python-api for check motion detector and http://www.tinkerforge.com/en/doc/Software/Bricklets/Humidity_Bricklet_Python.html#humidity-bricklet-python-api all work fine. I need to integrate motion sensors and humidity in nagios. Can anyone give me some guidance? I can find a wiki for this? regards Zitieren
photron Geschrieben August 5, 2015 at 14:39 Geschrieben August 5, 2015 at 14:39 We already cover this in the documentation of the Starter Kit: Server Monitoring. You can find a script there that already does what you ask for: http://www.tinkerforge.com/en/doc/Kits/ServerRoomMonitoring/ExtendedNagios.html Zitieren
luca219 Geschrieben August 6, 2015 at 07:43 Autor Geschrieben August 6, 2015 at 07:43 thanks for replay, i tried this script, but show always "motion detected" /usr/lib/nagios/plugins/check_tf_temp_ext.py -H localhost -u sKh -t motion_detector motion detected Zitieren
photron Geschrieben August 6, 2015 at 13:09 Geschrieben August 6, 2015 at 13:09 Ah, there was a bug in the script. It said "motion detected" if actually not motion was detected. It said "no motion detected" if actually motion was detected. I've fixed this now. There is a blue LED on the Motion Detector Bricklet that is on if motion is detected and is off if no motion is detected. You should now see that the script output matches the LED state. Zitieren
luca219 Geschrieben August 6, 2015 at 13:41 Autor Geschrieben August 6, 2015 at 13:41 yes if self.connected_type == TYPE_MOTION_DETECTOR: if val == 1: was the problem. Now work fine, thanks Zitieren
luca219 Geschrieben August 6, 2015 at 15:26 Autor Geschrieben August 6, 2015 at 15:26 I noticed that the "check" does not work with pnp4nagios. probably the output isn't in correct format. http://docs.pnp4nagios.org/pnp-0.6/perfdata_format someone has already seen the problem, you have any suggestions? Zitieren
photron Geschrieben August 11, 2015 at 16:33 Geschrieben August 11, 2015 at 16:33 Correct the output of the script doesn't follow the format pnp4nagios expects. The data pnp4nagios expects is all there, you just have to modify the print statements in the script to output them in the format pnp4nagios expects. Zitieren
luca219 Geschrieben August 14, 2015 at 08:05 Autor Geschrieben August 14, 2015 at 08:05 you give me some suggestions for how to do? regards Zitieren
photron Geschrieben August 17, 2015 at 16:46 Geschrieben August 17, 2015 at 16:46 There are several print statements in the code like this one: print "CRITICAL : %s too high %s %s" % (self.name, val, self.unit) According to the link pnp4nagios expects <whatever> | <label>=<value>;[<warn>];[<crit>];[<min>];[<max>] to be printed. The script currently only prints the <whatever> part. You can extend the print statements like this to add the part pnp4nagios is looking for: print "CRITICAL : %s too high %s %s" % (self.name, val, self.unit) + " | " + self.name + "=" + str(val) Zitieren
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.