Service alert recovery message problem

i’m using latest librenms/docker by crazy-max, container work perfectly.
i enable service menu for nagios-plugin, created rule as per official documentation
and create my personal alert template.

All work perfect but when service alert recovery the value[service_message] in template remain the nagios message of fail

it is normal behavior of service option? because i come from pure nagios-core and wanted to understand how it works here…

tnks

Can you post your alert rule and template please so I can duplicate it?

my rule from official docs

my simple template for testing

i add @if ($alert-> state !=0) for not show message when service recovery, but if you remove condition block value of service_message not change… and print service error status.

in pure nagios i see recovey plugin message of fault and recovery

sorry for my english

Can you post the template as text so I can copy / paste please?

You’re English is great btw :slight_smile:

@if ($alert->state == 0) Recovered {{ $alert->hostname }} Time elapsed: {{ $alert->elapsed }} @endif
@if ($alert->state == 1) Critical {{ $alert->hostname }} @endif
Problem:
@foreach ($alert->faults as $key => $value)
#{{ $key }}: {{ $value[‘service_type’] }}
#Error Msg: {{ $value[‘service_message’] }}
@endforeach

i remove for you “if state” for show msg

It’s because the data we store about the service isn’t live, it’s cached from when the fault was active.

Replace that line above with:

#Error Msg: {{ \App\Models\Service::find($value['service_id'])->service_message }}

A side note, I couldn’t get your template to work at all but that line above will give you what you need

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.