Page 1 of 1
Diffirent email notifications for a single service.
Posted: Mon Dec 29, 2025 12:39 am
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?
Re: Diffirent email notifications for a single service.
Posted: Mon Dec 29, 2025 10:30 am
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.
Re: Diffirent email notifications for a single service.
Posted: Mon Dec 29, 2025 6:42 pm
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.
Re: Diffirent email notifications for a single service.
Posted: Tue Dec 30, 2025 6:09 pm
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?
Re: Diffirent email notifications for a single service.
Posted: Wed Jan 07, 2026 10:36 pm
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.