{% include "head.html" %} {% include "navbar.html" %}

Service: {{ service.service }}

{% if service.staticly_configured %} {% endif %} {% if not service.staticly_configured %} Modify Delete {% else %}
This service is staticly configured, to edit or delete it, you have to modify the configuration file on the server.
{% endif %}

Show in Icinga

{% if status_list | length > 0 %}

{{ status_list[0].status }} submitted on {{ status_list[0].human_date() }}

{% else %}

No status for this service submitted

{% endif %}
{% if service.special_type == "SMART" %}
Smart Monitor {% if smart %} for: {{ smart.model_number }} {% endif %}
Example below requires smartmontools ("smartctl") in PATH. On Linux this is usually available via the package manager, on Windows install it from the offical page.
{% endif %} {% if smart %}
Linux
{% else %}
Curl
{% endif %}
{% if smart %} SMART='{
"service" : "{{ service.service }}",
"token" : "{{ service.token }}",
"status" : "N/A",
"smart" : '$(/sbin/smartctl -a /dev/nvme0n1 --json)'
}'

curl -X POST -H "Content-Type: application/json" \
--data "${SMART}" \
{{ flask.request.url_root.replace("http://", "https://" )}}report
{% else %} curl -X POST \
-H "Content-Type: application/json" \
-d '{ "service" : "{{ service.service }}", "token" : "{{ service.token }}",
"status" : "OK", "info" : "Free Text Information here" }' \
{{ flask.request.url_root.replace("http://", "https://" )}}report
{% endif %}
{% if smart %}
Windows
$SMART = @{
service = "{{ service.service }}"
token = "{{ service.token }}"
status = "N/A"
smart = "$(smartctl -a C: --json | Out-String)"
} | ConvertTo-Json

Invoke-RestMethod -TimeoutSec 2 -Uri "{{ flask.request.url_root.replace("http://", "https://" )}}report" -Method Post -Headers @{"Content-Type"="application/json"} -Body $SMART
{% else %}
Python
import requests
requests.post("{{ flask.request.url_root.replace("http://", "https://")}}report",
json= { "service" : "{{ service.service }}",
"token" : "{{ service.token }}",
"status" : "OK",
"info" : "additional information" })
{% endif %} {% for status in status_list %} {% endfor %}
Date Status Info
{{ status.human_date() }} {{ status.status }} {{ status.info_text }}