Monit for mosquitto

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
costo
Posts: 71
Joined: Tuesday 11 August 2015 17:35
Target OS: Linux
Domoticz version: 2025.1
Location: Netherlands
Contact:

Monit for mosquitto

Post by costo »

Followed the wiki and installed monit for domoticz, that works perfect.
I have this part in /etc/monit/monitrc for domoticz

Code: Select all

  check process domoticz with pidfile /var/run/domoticz.pid
  start program = "/etc/init.d/domoticz.sh start"
  stop  program = "/etc/init.d/domoticz.sh stop"

  if failed
     url http://127.0.0.1:8080/json.htm?type=command&param=getversion
         and content = '"status" : "OK"'
     for 2 cycles
     then restart
  if 5 restarts within 5 cycles then exec "/sbin/reboot"
Now I like to monitor mosquitto also , so i added this at the end of /etc/monit/monitrc

Code: Select all

  check process mosquitto with pidfile /var/run/mosquitto.pid
  start program = "/etc/init.d/mosquitto start"
  stop  program = "/etc/init.d/mosquitto stop"
I got a new Monit mosquitto page, but it does not work as supposed. After initialising it says: execution failed.
What can I do to make this work ?

Note: I run jessie on a raspberryPi 2b
SweetPants

Re: Monit for mosquitto

Post by SweetPants »

mosquitto does not use a PID, look in /var/run
costo
Posts: 71
Joined: Tuesday 11 August 2015 17:35
Target OS: Linux
Domoticz version: 2025.1
Location: Netherlands
Contact:

Re: Monit for mosquitto

Post by costo »

Thanks for the reply
SweetPants wrote: Sunday 03 December 2017 17:44 mosquitto does not use a PID, look in /var/run

I see a /var/run/mosquitto.pid file , just as domoticz has one, both 6 Bytes in size. In mosquitto.pid there is a number which is different all the time.
The only difference is in the permissions, domoticz.pid = --- and mosquitto.pid = r--

After removing the line "check process mosquitto with pidfile /var/run/mosquitto.pid" from monitrc, monit does no longer have a page named mosquitto.
This is no solution for monitoring mosquitto
tonbor
Posts: 153
Joined: Monday 17 February 2014 9:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Monit for mosquitto

Post by tonbor »

here is the answer, for people to help https://rouwette.com/install-monit/
Kedi
Posts: 575
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Monit for mosquitto

Post by Kedi »

Mine is:

Code: Select all

check process mosquitto matching "mosquitto"
     start program = "/bin/systemctl start mosquitto"
     stop program = "/bin/systemctl stop mosquitto"
     if 4 restarts within 5 cycles then alert
     if 5 restarts within 5 cycles then timeout
Logic will get you from A to B. Imagination will take you everywhere.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest