Nagiosxi API

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mejokj
Posts: 353
Joined: Mon Jul 22, 2013 10:31 pm

Nagiosxi API

Post by mejokj »

Hello,

i need to update below things using API
1. mics settings status image and icon image using API.

2. bulk check for all service on given host using API.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagiosxi API

Post by ssax »

1. See Help > Config Reference:

You would use these in your API commands while adding/updating the host:

Code: Select all

icon_image=yourimage.png
statusmap_image=yourimage.png

Code: Select all

curl -k -L -XPUT "https://X.X.X.X/nagiosxi/api/v1/config/host/THEHOSTNAME?apikey=YOURAPIKEY&pretty=1&address=X.X.X.X&notification_interval=30&icon_image=yourimage.png&statusmap_image=yourimage.png&applyconfig=1"
For services there is only icon_image:

Code: Select all

icon_image=yourimage.png

Code: Select all

curl -k -L -XPUT "https://X.X.X.X/nagiosxi/api/v1/config/service/THEHOSTNAME/THESERVICENAME?apikey=YOURAPIKEY&pretty=1&display_name=XXXXXXX&icon_image=yourimage.png&applyconfig=1"
2. See Help > System Reference > corecommand

Code: Select all

curl -k -L -vvv -XPOST "https://X.X.X.X/nagiosxi/api/v1/system/corecommand?apikey=YOURAPIKEY" -d "cmd=SCHEDULE_FORCED_HOST_SVC_CHECKS;THEHOSTNAME;$(date +%s)"
Taken from here:

https://assets.nagios.com/downloads/nag ... and_id=130
https://assets.nagios.com/downloads/nag ... ernalcmds/
Locked