New in Nagios XI 5 is a API that includes far more features and control over the Nagios XI system. This documentation explains how to use the new API to read, write, delete, and update data in the Nagios XI system through commands that are authenticated via Nagios XI API keys. The new API uses JSON instead of XML. However, with the release of Nagios XI 5 there are multiple output formats for the original backend API. It is recommended to use the new API over the old backend API. More information about the original backend API can be found in the backend API URL component.
To gain access to the new API use the URL formatted as such:
http://cammstech.my3cx.ca/nagiosxi/api/v1/
The API is split into three separate sections.
Each user has their own API key to access the API. Normal users are allowed to have read access if the Allow API Access setting is selected in the user management Edit/Create pages. Every admin has full access to the API. Access to the documentation is restricted to users who have API access. Normal XI users, which have read only API access, will only be able to see the documentation about the objects section.
Whether you connect via a browser, cURL, or any other way you will need to pass the API key as a GET variable named apikey
just like the example in Getting Started.
Your API Key: 9FlXU94C0fXUkYsPMiEY383F2tqfMenU9L93bsVbKSl47R999M7caq7rWA0Y4nTc
Access Level: Full Access
The example below is using the GET system/status
command which shows general information about this Nagios XI server. Adding pretty=1
to the URL will print the JSON in human readable format like the example below and can be used on any API request that returns output.
curl -XGET "http://cammstech.my3cx.ca/nagiosxi/api/v1/system/status?apikey=9FlXU94C0fXUkYsPMiEY383F2tqfMenU9L93bsVbKSl47R999M7caq7rWA0Y4nTc&pretty=1"
{ "instance_id": "1", "instance_name": "localhost", "status_update_time": "2015-09-21 01:28:06", "program_start_time": "2015-09-20 12:21:20", "program_run_time": "47212", "program_end_time": "0000-00-00 00:00:00", "is_currently_running": "1", "process_id": "105075", "daemon_mode": "1", "last_command_check": "1969-12-31 18:00:00", "last_log_rotation": "2015-09-21 00:00:00", "notifications_enabled": "1", "active_service_checks_enabled": "1", "passive_service_checks_enabled": "1", "active_host_checks_enabled": "1", "passive_host_checks_enabled": "1", "event_handlers_enabled": "1", "flap_detection_enabled": "1", "process_performance_data": "1", "obsess_over_hosts": "0", "obsess_over_services": "0", "modified_host_attributes": "0", "modified_service_attributes": "0", "global_host_event_handler": "xi_host_event_handler", "global_service_event_handler": "xi_service_event_handler" }
www.nagios.com
Copyright (c) 2009-2024 Nagios Enterprises, LLC
Note: These pages require a browser which supports frames