Hi,
I found that it is possible to filter ther services and hosts in the API call hoststatus and servicestatus by current_state = <<state number>>
is it possible to filter by a negation? I would need to retrieve all services or hosts where the status is different from OK.
if that is not possible where are all the status codes documented for reference?
regards
Luca
Nagios XI API current_state not equal to 0
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios XI API current_state not equal to 0
There are a few special operands, for this you can use
or
Code: Select all
¤t_state=ne:0Code: Select all
¤t_state=in:1,2,3Re: Nagios XI API current_state not equal to 0
that was very helpful!
is there a document with all these special operans for the API? I have been looking for it without luck.
is there a document with all these special operans for the API? I have been looking for it without luck.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios XI API current_state not equal to 0
I don't think we have a documented list, but I grabbed these to give a quick explanation of each:
ne: - not equal
lt: - less than
lte: - less than or equal
gt: - greater than
gte: - greater than or equal
lks: - Beginning string match
nlks: - Negative beginning string match
lke: - Ending string match
nlke: - Negative ending string match
lk: - Mid string match
nlk: - Negative mid string match
in: - In match (matches a list of comma separated results
nin: - Negative "in" match
ne: - not equal
lt: - less than
lte: - less than or equal
gt: - greater than
gte: - greater than or equal
lks: - Beginning string match
nlks: - Negative beginning string match
lke: - Ending string match
nlke: - Negative ending string match
lk: - Mid string match
nlk: - Negative mid string match
in: - In match (matches a list of comma separated results
nin: - Negative "in" match