Monit information in Domoticz?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.
Post Reply
manjh
Posts: 242
Joined: Saturday 27 February 2016 13:49
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: NL
Contact:

Monit information in Domoticz?

Post by manjh » Sunday 03 September 2017 22:31

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?
Hans

manjh
Posts: 242
Joined: Saturday 27 February 2016 13:49
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: NL
Contact:

Re: Monit information in Domoticz?

Post by manjh » Tuesday 05 September 2017 17:48

Any ideas? :o
Hans

uNGam3R
Posts: 42
Joined: Wednesday 24 December 2014 14:23
Target OS: Raspberry Pi
Domoticz version: beta
Location: Toulouse, France
Contact:

Re: Monit information in Domoticz?

Post by uNGam3R » 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.
---------------------------------------
Want more about Domoticz scripts and DiY devices?
Go to ---------- http://mydomotic.blogspot.com

manjh
Posts: 242
Joined: Saturday 27 February 2016 13:49
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: NL
Contact:

Re: Monit information in Domoticz?

Post by manjh » Tuesday 05 September 2017 20:58

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?
Hans

User avatar
EddyG
Posts: 124
Joined: Monday 02 November 2015 6:54
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Netherlands
Contact:

Re: Monit information in Domoticz?

Post by EddyG » Tuesday 05 September 2017 21:05

What kind of info from Monit would you like to use in Domoticz?
Regards,
Eddy

manjh
Posts: 242
Joined: Saturday 27 February 2016 13:49
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: NL
Contact:

Re: Monit information in Domoticz?

Post by manjh » Tuesday 05 September 2017 21:15

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.
Hans

User avatar
EddyG
Posts: 124
Joined: Monday 02 November 2015 6:54
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Netherlands
Contact:

Re: Monit information in Domoticz?

Post by EddyG » 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
Regards,
Eddy

manjh
Posts: 242
Joined: Saturday 27 February 2016 13:49
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: NL
Contact:

Re: Monit information in Domoticz?

Post by manjh » Tuesday 05 September 2017 22:03

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?
Hans

User avatar
EddyG
Posts: 124
Joined: Monday 02 November 2015 6:54
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Netherlands
Contact:

Re: Monit information in Domoticz?

Post by EddyG » Wednesday 06 September 2017 9:00

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......
Regards,
Eddy

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests