Page 1 of 1

Email alerts with acknowledgment comments

Posted: Tue Feb 11, 2020 11:30 am
by mejokj
Hello,

Is there any way we can get the Email alerts and with acknowledgment comments?

Re: Email alerts with acknowledgment comments

Posted: Tue Feb 11, 2020 12:17 pm
by scottwilkerson
See the available macros here
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

Posted: Wed Feb 12, 2020 9:11 am
by mejokj
Hello,
Thanks it's working.

Is there any API used to fetch the Acknowledge service details list in Nagios xi?

Re: Email alerts with acknowledgment comments

Posted: Wed Feb 12, 2020 9:41 am
by scottwilkerson
mejokj wrote:Is there any API used to fetch the Acknowledge service details list in Nagios xi?
If you are looking to see if services are Acknowledged you can use the objects/servicestatus
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=1

Re: Email alerts with acknowledgment comments

Posted: Thu Feb 13, 2020 3:30 am
by mejokj
Hello,

Is there any way to get the below details from API?

Acknowledge Time:
Acknowledge By :
Acknowledge comment:

Re: Email alerts with acknowledgment comments

Posted: Thu Feb 13, 2020 8:19 am
by scottwilkerson
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

Code: Select all

&logentry_data=lk:EXTERNAL COMMAND: ACKNOWLEDGE
Which would give you a result like this

Code: 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 host was oraclelinux7.nagios.local
The service was / Disk Usage
The user was: Nagios Administrator
The message was: Problem has been acknowledged

Re: Email alerts with acknowledgment comments

Posted: Sun Feb 16, 2020 8:46 am
by mejokj
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

Re: Email alerts with acknowledgment comments

Posted: Mon Feb 17, 2020 7:37 am
by scottwilkerson
You should see this info in the API no matter which options are checked.

Re: Email alerts with acknowledgment comments

Posted: Tue Feb 18, 2020 10:47 am
by mejokj
Hello,

When we untick all option it will give no output for Acknowledged comment service list.

{
"recordcount": "0"
}

Re: Email alerts with acknowledgment comments

Posted: Tue Feb 18, 2020 1:25 pm
by scottwilkerson
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

Code: Select all

/nagiosxi/api/v1/objects/logentries?apikey=APIKEY&pretty=1&logentry_data=lk:EXTERNAL COMMAND: ACKNOWLEDGE
And see the following as expected

Code: 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"
    }
}