Nagios XI 5.4.3 Rest API
Posted: Tue Apr 04, 2017 2:46 pm
Hi,
I use a lot your rest api and it's working fine. I think I found 1 exception you have to handle or help me to understand the result I have. I debug a lot my code and the only explaination I have is the rest api is not case sensitive.
I make sure Nagios XI already have that check before :
I try to add another check by the API with that payload :
I see an update of my original check instead of add a new check. I really have two file system /opt/IBM and /opt/ibm.
Normaly I use my python script to automagicaly add all the stuff I want to monitor by NCPA to NAgios XI. It's working fine. I also try the same patern with a simple curl -XPOST and I have the same result. I have to use force=1 because I use template. If you need more detail I will do my best but keep in mind I normaly speak/write in french and I do my best to explain
(Google Translate)
Thank you!
I use a lot your rest api and it's working fine. I think I found 1 exception you have to handle or help me to understand the result I have. I debug a lot my code and the only explaination I have is the rest api is not case sensitive.
I make sure Nagios XI already have that check before :
Code: Select all
{
"@attributes": {
"id": "8963"
},
"instance_id": "1",
"host_name": "servername",
"service_description": "Disk Usage on \/opt\/IBM",
"is_active": "1",
"config_type": "1",
"display_name": "Disk Usage on \/opt\/IBM",
"check_interval": "5",
"retry_interval": "1",
"max_check_attempts": "5",
"first_notification_delay": "0",
"notification_interval": "60",
"passive_checks_enabled": "1",
"active_checks_enabled": "1",
"notifications_enabled": "1",
"notes": "",
"notes_url": "",
"action_url": "",
"icon_image": "",
"icon_image_alt": ""
},
Code: Select all
{'service_description': u'Disk Usage on /opt/ibm', 'use': 'xi_prod_middle_ncpa_service', 'check_command': u"check_xi_ncpa!-t 'mytoken' -P 5693 -M 'disk/logical/|opt|ibm' -u M -w 90 -c 95!!!!!!!", 'force': '1', 'host_name': 'servername'}
Normaly I use my python script to automagicaly add all the stuff I want to monitor by NCPA to NAgios XI. It's working fine. I also try the same patern with a simple curl -XPOST and I have the same result. I have to use force=1 because I use template. If you need more detail I will do my best but keep in mind I normaly speak/write in french and I do my best to explain
Thank you!