Automation with the REST API

Being able to automate various actions can save you a lot of time that you would otherwise spend on adding hosts, contacts, or service checks, for instance.

Try running the following command that will output the configuration for the Opsview server:

/usr/local/nagios/bin/opsview_rest --username=admin --password=initial --pretty --data-format=json GET config/host?s.name=opsview

The REST API is able to perform nearly any task that you can do using the web interface, so it is a great tool for those looking into automation.

Configuration

You can add contacts, hosts, host templates and host groups, service groups, notification methods, attributes and keywords, time periods, and so on using the REST API.

The following are some ...

Get Monitoring with Opsview now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.