4uba
20 February 2019 18:06
1
Hi Guys,
I have tough days with these new alert frankly
Could you please support me in this - I would like to add info into my UPS alert with next data:
So, during regular alert, I would like to have 3 strings of data Input / Output / Battery voltage.
How can should I create this alert?
BTW, I googled examples like this, and I have not found ones, so, probably this topic will be useful for other people if someone help me with it!
Thanks a lot guys!
P.S. Direct image link: Original image
Chas
21 February 2019 18:52
2
You can get the value from the column names in your alert template,
for example check this one , i think thats old syntax though so you will need to convert using the convert button on the template page.
I’m trying to get more descriptive with my email alerts. In particular the Wireless Sensor.
I can see in the web interface that there is a sensor_desc that tells me what part of the wireless sensor is in alert.
what variable do I need to use to pull that information into my alert template?
Here is the raw alert
#1: sensor_id => ‘5658’, sensor_descr => ‘Clients (na)’, sensor_oids => ‘[".1.3.6.1.4.1.41112.1.6.1.2.1.8.3",".1.3.6.1.4.1.41112.1.6.1.2.1.8.4"]’, sysObjectID => ‘.1.3.6.1.4.1.8072.3…
4uba
21 February 2019 19:25
3
Hi Chas,
With static info as %hostname, %state etc it’s okay for me.
I don’t know hot to specify, that I would like to receive info from sensor_id=92 from column sensor_current. That is my problem.
Chas
21 February 2019 19:38
4
isn’t it this part in the templates docs?
You could specify {{ $value['sensor_current'] }}
Temperature Sensors:
{{ $alert->title }}
Device Name: {{ $alert->hostname }}
Severity: {{ $alert->severity }}
Timestamp: {{ $alert->timestamp }}
Uptime: {{ $alert->uptime_short }}
@if ($alert->state == 0) Time elapsed: {{ $alert->elapsed }} @endif
Location: {{ $alert->location }}
Description: {{ $alert->description }}
Features: {{ $alert->features }}
Purpose: {{ $alert->purpose }}
Notes: {{ $alert->notes }}
Rule: @if ($alert->name) {{ $alert->name }} @else {{ $alert->rule }} @endif
@if ($alert->faults) Faults:
@foreach ($faults as $key => $value)
#{{ $key }}: Temperature: {{ $value['sensor_current'] }} °C
** @php echo ($value['sensor_current']-$value['sensor_limit']); @endphp°C over limit
Previous Measurement: {{ $value['sensor_prev'] }} °C
High Temperature Limit: {{ $value['sensor_limit'] }} °C
@endforeach
@endif
4uba
21 February 2019 19:56
5
[quote=“Chas, post:4, topic:7385”]
Sure, it is, but probably I have not clearly explain my question. Sorry about that.
So, in this example, we got $key as $value, and output all data from this particular sensor.
But how can I request info about another sensor data in the same template? Is it possible?
Chas
21 February 2019 23:05
6
ahh i see what you mean, you want to grab data from all 3 rows in that alert output. I don’t think its possible, i wonder if you include the sensor ids in your alert query somehow, whether it then appears in the output string
@if ($alert->faults) Faults:
@foreach ($alert->faults as $key => $value)
{{ $key }}: {{ $value['string'] }}
@endforeach