I’m trying to write my first SmartApp/Device Handler. I’ve gone through the tutorials, but have a slightly ‘off’ situation I’m trying to resolve. My app is intended to monitor the changing state of a software application running on a physical server. The server itself has a REST/SOAP API. My thought is that I can write a DH/SM to periodically (say every 2 seconds) make a call to one of the state APIs on the server to ensure that it and the services it provides are up; if not, cycle a smart outlet (basically to trigger a reboot of the physical server.) In detail, basically, if my VMware ESXi server is not responsive, force a reboot via power cycle. My email server and some other “always on” services are hosted on this server, and I want it to always be up.
The specific questions I have are:
1) In looking at the ServiceManager example, I see that the SM has to do discovery via SSDP/UPnP. Do I explicitly need to do that if I already know the IP and PORT of the server? Or, can I simply stub it out with some hard-coded values since ESXi doesn’t support UPnP? Then, do IP communication since I know the device will always be on and has a static IP address.
2) OR, would it be better to use something like Zabbix or Monit to constantly check the state of the ESXi server and push alerts to ST (then have ST work its magic)?
Thanks in advance!