iT邦幫忙

1

Librenms ssl憑證檢查 通知方式-已解決

  • 分享至 

  • xImage

請問我在建立Librenms ssl憑證檢查
透過telagram通知 想要輸出services中的message
在templates該如何描述

我想收到以下message的內容
https://ithelp.ithome.com.tw/upload/images/20251031/20116915GBz3DbK7T4.png
telegram收到的訊息
https://ithelp.ithome.com.tw/upload/images/20251031/20116915AKm7HOsXdS.png
template的描述
https://ithelp.ithome.com.tw/upload/images/20251031/20116915a9ZAAlMYjp.png

11/03更-從ChatGPT問到答案了..

@if ($alert-> state == 0) 😀 告警狀況解除 😀 @endif
@if ($alert-> state == 1) 😟 請檢查 SSL 憑證或服務狀態 😟 @endif

主機:{{ $alert->hostname }}
服務:@foreach ($alert->faults as $key => $value)
  - 描述:{{ $value['service_desc'] }}
  - FQDN:{{ $value['service_ip'] }}
  - 類型:{{ $value['service_type'] }}
  - 訊息:{{ $value['service_message'] }}
@endforeach
觸發時間:{{ $alert->timestamp }}

https://ithelp.ithome.com.tw/upload/images/20251103/201169156Opm6so8HS.png

圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
尼克
iT邦大師 1 級 ‧ 2025-10-31 13:59:27
@if ($alert-> state == 0) ℹ️恢復ℹ️ @endif
@if ($alert-> state == 1) ⚠️告警⚠️ @endif

【標題】:{{ $alert->title }}
【規則】: {{ $alert->name }}
【嚴重性】: {{ $alert->severity }}

【設備名稱】: {{ $alert->sysName }}
【IP】: {{ $alert->hostname }}
【OS】: {{ $alert->os }}

【警示時間】: {{ $alert->timestamp }}
@if ($alert->state == 0)
【經過時間】: {{ $alert->elapsed }}
@endif
【運行時間】: {{ $alert->uptime_short }}
【設備所在位置】: {{ $alert->location }}
【備註】: {{ $alert->notes }}

我的alter template 範例借你參考。
https://docs.librenms.org/Alerting/Templates/

kmdodo8 iT邦新手 5 級 ‧ 2025-11-03 09:22:47 檢舉

感謝提翁,有另一Template,屬於server有異常時發報。

目前想找的是ssl憑證到期前通知,或是透過其他方式通知也可以。

我要發表回答

立即登入回答