Query Service DisplayName

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
FCC_Nagios_Support
Posts: 161
Joined: Tue Mar 10, 2020 11:07 am

Query Service DisplayName

Post by FCC_Nagios_Support »

Good Morning,
How can I query the service displayname by api
Thks
KR
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Query Service DisplayName

Post by ssax »

This should do it:

Code: Select all

yum install jq
curl --silent -k -L 'http://YOURXISERVER/nagiosxi/api/v1/objects/servicestatus?apikey=YOURAPIKEY&pretty=1&host_name=localhost&service_description=SSH' | jq -r '.servicestatus[] .display_name'
FCC_Nagios_Support
Posts: 161
Joined: Tue Mar 10, 2020 11:07 am

Re: Query Service DisplayName

Post by FCC_Nagios_Support »

Many thanks I am gonna try
KR
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Query Service DisplayName

Post by benjaminsmith »

Hi,

Sounds good. Let us know that works for you.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Query Service DisplayName

Post by ssax »

Locking thread, ticket received, we will continue support through the ticket.

Thank you!
Locked