Diffirent email notifications for a single service.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
mepanousis
Posts: 2
Joined: Mon Dec 29, 2025 12:28 am

Diffirent email notifications for a single service.

Post by mepanousis »

Hello all,

I am monitoring a new service where, in addition to the service state, I need the full plugin output.

The currently configured email command is set to include only the first line of the service output, and this behavior must remain unchanged for all existing services.

However, for this specific new service, I need the entire output, which is a table containing a large amount of data.

I created a new email command that works perfectly, but so far I haven’t found a valid way to assign this command only to this single service.

I also tried passing the extra data by adding an argument ($ARG1$) to the service command and using that argument for my SQL query. Unfortunately, the SQL command is around 1000 characters long, and it seems that Nagios XI cannot handle such a long argument.

Does anyone have any ideas or best practices for handling this?
DoubleDoubleA
Posts: 273
Joined: Thu Feb 09, 2017 5:07 pm

Re: Diffirent email notifications for a single service.

Post by DoubleDoubleA »

If you can execute a SQL command, you can execute a bash file with the SQL command in it, right?

Maybe try that.
kg2857
Posts: 490
Joined: Wed Apr 12, 2023 5:48 pm

Re: Diffirent email notifications for a single service.

Post by kg2857 »

Your objectives are unclear. Are you having trouble defining a service with a large argument, handling the output, or getting the data you want in notifications?
By definition, nagios plugins return, and nagios acts on a single line of of output. In reality nagios handles multi-line output at least somewhat. How the notification script handles the data is another question that you'll probably need to research.
mepanousis
Posts: 2
Joined: Mon Dec 29, 2025 12:28 am

Re: Diffirent email notifications for a single service.

Post by mepanousis »

kg2857 wrote: Mon Dec 29, 2025 6:42 pm Your objectives are unclear. Are you having trouble defining a service with a large argument, handling the output, or getting the data you want in notifications?
By definition, nagios plugins return, and nagios acts on a single line of of output. In reality nagios handles multi-line output at least somewhat. How the notification script handles the data is another question that you'll probably need to research.
Hello,

My problem is the following:

I want to send by email the full output of a specific service when it goes into a WARNING state, and I want this email to be sent only to a specific contact.

This contact group already has an email notification command assigned, which sends only the first line of the host/service output, and this must not be changed.

I created a new email notification command that sends the full service output. However, if I assign this new command to the same contact group, they will receive two notifications for the same alert:

one with the short output

one with the full output

This would result in unnecessary email spam.

I can:

assign services to contacts,

assign notification commands to contacts,

but so far I cannot find a way to specify a different email notification command for a single service only.

Is there a way to achieve this?
Aliyaa
Posts: 8
Joined: Wed Jun 21, 2023 10:38 am
Location: India
Contact:

Re: Diffirent email notifications for a single service.

Post by Aliyaa »

mepanousis wrote: Tue Dec 30, 2025 6:09 pm
kg2857 wrote: Mon Dec 29, 2025 6:42 pm Your objectives are unclear. Are you having trouble defining a service with a large argument, handling the output, or getting the data you want in notifications?
By definition, nagios plugins return, and nagios acts on a single line of of output. In reality nagios handles multi-line output at least somewhat. How the notification script handles the data is another question that you'll probably need to research.
Hello,

My problem is the following:

I want to send by email the full output of a specific service when it goes into a WARNING state, and I want this email to be sent only to a specific contact.

This contact group already has an email notification command assigned, which sends only the first line of the host/service output, and this must not be changed.

I created a new email notification command that sends the full service output. However, if I assign this new command to the same contact group, they will receive two notifications for the same alert:

one with the short output

one with the full output

This would result in unnecessary email spam.

I can:

assign services to contacts,

assign notification commands to contacts,

but so far I cannot find a way to specify a different email notification command for a single service only.

Is there a way to achieve this?
You can’t override notification commands per service for the same contact. The practical result is to create a separate contact/contactgroup (or use notification escalations) and assign the full-output command only to that service.
Post Reply