Email alerts with acknowledgment comments
Email alerts with acknowledgment comments
Hello,
Is there any way we can get the Email alerts and with acknowledgment comments?
Is there any way we can get the Email alerts and with acknowledgment comments?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Email alerts with acknowledgment comments
See the available macros here
https://assets.nagios.com/downloads/nag ... iables.pdf
most notable in this situation
https://assets.nagios.com/downloads/nag ... iables.pdf
most notable in this situation
%author% The name of the author of an acknowledgment. Only present if %type% macro is ACKNOWLEDGEMENT
%comments% - The comment made by the author of an acknowledgment. Only present if %type% macro is ACKNOWLEDGEMENT
Re: Email alerts with acknowledgment comments
Hello,
Thanks it's working.
Is there any API used to fetch the Acknowledge service details list in Nagios xi?
Thanks it's working.
Is there any API used to fetch the Acknowledge service details list in Nagios xi?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Email alerts with acknowledgment comments
If you are looking to see if services are Acknowledged you can use the objects/servicestatusmejokj wrote:Is there any API used to fetch the Acknowledge service details list in Nagios xi?
the field you would be looking at is problem_acknowledged
If you only want to see Acknowledged problems you can add the following to the URL
Code: Select all
&problem_acknowledged=1Re: Email alerts with acknowledgment comments
Hello,
Is there any way to get the below details from API?
Acknowledge Time:
Acknowledge By :
Acknowledge comment:
Is there any way to get the below details from API?
Acknowledge Time:
Acknowledge By :
Acknowledge comment:
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Email alerts with acknowledgment comments
This isn't natively supported in the API like that, but you can see the entried by querying the objects/logentries API and appending the following to the URL
Which would give you a result like this
The host was oraclelinux7.nagios.local
The service was / Disk Usage
The user was: Nagios Administrator
The message was: Problem has been acknowledged
Code: Select all
&logentry_data=lk:EXTERNAL COMMAND: ACKNOWLEDGECode: Select all
{
"recordcount": "1",
"logentry": {
"instance_id": "1",
"entry_time": "2020-02-13 07:05:24",
"logentry_type": "512",
"logentry_data": "EXTERNAL COMMAND: ACKNOWLEDGE_SVC_PROBLEM;oraclelinux7.nagios.local;\/ Disk Usage;2;1;0;Nagios Administrator;Problem has been acknowledged"
}
}The service was / Disk Usage
The user was: Nagios Administrator
The message was: Problem has been acknowledged
Re: Email alerts with acknowledgment comments
Hello,
Yes, this will give information only when I tick send the notification option. we are trying with three options untick for the acknowledgment and we didn't get any result on that sensoria, Is there any option we can mention to get all the details with three options untick.
Please see the below link which we untick. Stick acknowledgment, send notification and persistence comment.
https://ibb.co/PxNfhnx
Yes, this will give information only when I tick send the notification option. we are trying with three options untick for the acknowledgment and we didn't get any result on that sensoria, Is there any option we can mention to get all the details with three options untick.
Please see the below link which we untick. Stick acknowledgment, send notification and persistence comment.
https://ibb.co/PxNfhnx
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Email alerts with acknowledgment comments
You should see this info in the API no matter which options are checked.
Re: Email alerts with acknowledgment comments
Hello,
When we untick all option it will give no output for Acknowledged comment service list.
{
"recordcount": "0"
}
When we untick all option it will give no output for Acknowledged comment service list.
{
"recordcount": "0"
}
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Email alerts with acknowledgment comments
I just tested this, had nothing in acknowledged state
Went to service status detail page in Nagios XI for a non-OK service
Acknowledged the problem, unchecking all boxes
Then went to the following URI
And see the following as expected
Went to service status detail page in Nagios XI for a non-OK service
Acknowledged the problem, unchecking all boxes
Then went to the following URI
Code: Select all
/nagiosxi/api/v1/objects/logentries?apikey=APIKEY&pretty=1&logentry_data=lk:EXTERNAL COMMAND: ACKNOWLEDGECode: Select all
{
"recordcount": "1",
"logentry": {
"instance_id": "1",
"entry_time": "2020-02-18 12:15:14",
"logentry_type": "512",
"logentry_data": "EXTERNAL COMMAND: ACKNOWLEDGE_SVC_PROBLEM;oraclelinux7.nagios.local;\/ Disk Usage;1;0;0;Nagios Administrator;Problem has been acknowledged"
}
}