Email alerts with acknowledgment comments

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

Email alerts with acknowledgment comments

Post by mejokj »

Hello,

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mejokj
Posts: 353
Joined: Mon Jul 22, 2013 10:31 pm

Re: Email alerts with acknowledgment comments

Post by mejokj »

Hello,
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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mejokj
Posts: 353
Joined: Mon Jul 22, 2013 10:31 pm

Re: Email alerts with acknowledgment comments

Post by mejokj »

Hello,

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mejokj
Posts: 353
Joined: Mon Jul 22, 2013 10:31 pm

Re: Email alerts with acknowledgment comments

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Email alerts with acknowledgment comments

Post by scottwilkerson »

You should see this info in the API no matter which options are checked.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mejokj
Posts: 353
Joined: Mon Jul 22, 2013 10:31 pm

Re: Email alerts with acknowledgment comments

Post by mejokj »

Hello,

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

Post 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"
    }
}
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked