0

I have configured Monit version 5.6 on an Ubuntu 14.04 server. There are few check like filesystem usage, remote host connectivity check and service monitoring. Now, when I check the web gui of monit, I see something like this;

enter image description here

Now, there are many parameters that monit shows by default; Load average, CPU, Memory etc. I want to get all the parameters in my spring boot resp api so how can i get it.

1 Answers1

0

You could use/divert the Monit collector functionnality to get JSON to your application. See https://mmonit.com/monit/documentation/monit.html#MANAGE-YOUR-MONIT-INSTANCES for collector configuration.

Monit will send data to the configured collector, in JSON format, for all the checks configured in the Monit instance.

DevOps
  • 720
  • 3
  • 15
  • Are you sure about JSON? All my monits report in XML if used with my custom m/monit backend. You can also pull some XML at `/_status2?format=xml`. – boppy Nov 10 '19 at 15:37
  • How can I get the use/divert the Monit collector functionality to get Json to my application without using MMoint ? – Chag Vaibhav P Nov 11 '19 at 06:22
  • Monit will send XML as long as Tildeslash will not adopt JSON to the OSS-Version. So you'll have to convert this your own. I use a php script to receive, parse, and process the data, but you can also store and convert the XML data. I used (the now deprecated) [python XML2JSON Module](https://github.com/hay/xml2json). It's tiny, works well, and has no dependencies (like providing a schema). Because there's no schema, all datatypes are JSON-Strings. – boppy Nov 17 '19 at 11:34