Page 1 of 1

Monit information in Domoticz?

Posted: Sunday 03 September 2017 22:31
by manjh
I installed Monit, following the instructions in the Wiki. It runs fine, but I was wondering how to display info from Monit in Domoticz.
Is this possible? If so, is there a description somewhere?

Re: Monit information in Domoticz?

Posted: Tuesday 05 September 2017 17:48
by manjh
Any ideas? :o

Re: Monit information in Domoticz?

Posted: Tuesday 05 September 2017 18:16
by uNGam3R
it's possible using shell and a curl.
In a shell script just try :

Code: Select all

curl -Gs 'http://192.168.1.18:8080/json.htm' --data-urlencode "type=command" --data-urlencode "param=addlogmessage" --data-urlencode "message=${message}" --max-time 15 &>/dev/null &
You just need to define "${message}" and change the ip of domoticz with yours.
--max-time 15 sets a timeout to 15s
&>/dev/null removes the display
& allows to continue the script without waiting for the return of the command

hope it helps.

Re: Monit information in Domoticz?

Posted: Tuesday 05 September 2017 20:58
by manjh
uNGam3R wrote: Tuesday 05 September 2017 18:16 it's possible using shell and a curl.
In a shell script just try :

Code: Select all

curl -Gs 'http://192.168.1.18:8080/json.htm' --data-urlencode "type=command" --data-urlencode "param=addlogmessage" --data-urlencode "message=${message}" --max-time 15 &>/dev/null &
You just need to define "${message}" and change the ip of domoticz with yours.
--max-time 15 sets a timeout to 15s
&>/dev/null removes the display
& allows to continue the script without waiting for the return of the command

hope it helps.
I'm not there yet.
Where should I define this shell script? Which directory?
Where do I define the message? And which information is being transferred? I don't see a ref to a Monit file anywhere.
Am I missing something?

Re: Monit information in Domoticz?

Posted: Tuesday 05 September 2017 21:05
by EddyG
What kind of info from Monit would you like to use in Domoticz?

Re: Monit information in Domoticz?

Posted: Tuesday 05 September 2017 21:15
by manjh
EddyG wrote: Tuesday 05 September 2017 21:05 What kind of info from Monit would you like to use in Domoticz?
For starters, percentage-load would be good.
Reason is I just went through a confusing period where my R-Pi behaved strange and slow. Installed Monit and found a consistent load of 35 to 40%. Never knew it would be this high.
So I now move to a Pi-3, and Monit tells me it now runs at about 4%.

I want to ensure I see this in the future, if it happens.
So: total load of the R-Pi.

Re: Monit information in Domoticz?

Posted: Tuesday 05 September 2017 21:26
by EddyG
In Domoticz -> Setup -> Hardware you can select Motherboard.
Then you get a sensor CPU_Usage (and others).
That's the easy way.
A lot of the Monit Info can be fetch with scripting.
If you want to check outside of Domoticz but still have history, install RPi-Monitor

Re: Monit information in Domoticz?

Posted: Tuesday 05 September 2017 22:03
by manjh
EddyG wrote: Tuesday 05 September 2017 21:26 In Domoticz -> Setup -> Hardware you can select Motherboard.
Then you get a sensor CPU_Usage (and others).
That's the easy way.
A lot of the Monit Info can be fetch with scripting.
If you want to check outside of Domoticz but still have history, install RPi-Monitor
OK, got it and it works.
Is this based on Monit data, or can I remove that program now?

Re: Monit information in Domoticz?

Posted: Wednesday 06 September 2017 9:00
by EddyG
It is internal to Domoticz, has nothing to do with Monit.
You still can use Monit, just to monitor processes and restart them if they die.
I use it to monitor several processes.
So if Domoticz dies for some reason you can monitor that with Monit and restart Domoticz.
Also if Domoticz uses too much cpu you can let Monit send you an email with that cpu usage.
etc......