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.

Moderators: leecollings, remb0

Post Reply
manjh
Posts: 748
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Monit information in Domoticz?

Post 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?
Hans
manjh
Posts: 748
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Monit information in Domoticz?

Post by manjh »

Any ideas? :o
Hans
uNGam3R
Posts: 11
Joined: Wednesday 24 December 2014 13:23
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Toulouse, France
Contact:

Re: Monit information in Domoticz?

Post 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.
---------------------------------------
Want more about Domoticz scripts and DiY devices?
Go to ---------- http://mydomotic.blogspot.com
manjh
Posts: 748
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Monit information in Domoticz?

Post 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?
Hans
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Monit information in Domoticz?

Post by EddyG »

What kind of info from Monit would you like to use in Domoticz?
manjh
Posts: 748
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Monit information in Domoticz?

Post 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.
Hans
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Monit information in Domoticz?

Post 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
manjh
Posts: 748
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Monit information in Domoticz?

Post 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?
Hans
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Monit information in Domoticz?

Post 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......
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest