A really simple little utility that can monitor your Quix deployments from the command line (or in Emacs). This is only meant as a quick example of using the Portal API, but is surprisingly useful.
Run:
python3 qm.py
You can also dump to a file:
python3 qm.py > dump
and monitor in real time with tail
:
tail -f dump
or less
:
less +F dump
Quite simple to use in Emacs so you can monitor your deployments while getting some work done.
In emacs launch an ANSI term with M-x ansi-term RET bash
(or Zsh if you want).
Then in the ANSI terminal just type:
python3 qm.py > dump &
- this runs the monitor as a background process.less +F dump
- this displays the tail of the dump file so you can see your status.
It looks something like this:
This uses the Quix Portal API.
Obviously you can hack this around to improve the UI or display just want you need.
You'll need a bearer token for authentication. You can get this in the Quix Portal.
- Log in and click on your account profile pic and select "Tokens".
- You can set the longevity of the token.
- Then copy it to clipboard using the button provided.
Best use the token through a .env
file. The .env
file looks like:
TOKEN=your-token
That's it!
With Quix Sentinel (not an official product - I just made that up), you can get an SMS alert if your important deployment goes down for some reason.
This example does a request using the Portal API on a specific deployment, checks the status, and if not running, send an SMS to the configured admin using the Vonage SMS API.
See the example md-sms.py
. There's also another example md.py
that
monitors the specified deployment but doesn't send a text.
You can get a free Quix account by going here and then clicking "Sign Up".