doc:appunti:linux:sa:cacti_122
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
doc:appunti:linux:sa:cacti_122 [2019/09/26 11:41] – [Monitoraggio client remoto via NRPE] niccolo | doc:appunti:linux:sa:cacti_122 [2022/03/25 17:37] – [Check passivo] niccolo | ||
---|---|---|---|
Line 370: | Line 370: | ||
Il // | Il // | ||
- | In condizioni normali viene ricevuto un **check passivo** ogni 24 ore, quindi il check attivo giornaliero (// | + | In condizioni normali viene ricevuto un **check passivo** ogni 24 ore, quindi il check attivo giornaliero (// |
Per definire il servizio associato ad un host si aggiunge ad esempio nel file **/ | Per definire il servizio associato ad un host si aggiunge ad esempio nel file **/ | ||
Line 388: | Line 388: | ||
Il timestamp in formato Unix si può ottenere da una shell Unix con il comando **%%date +%s%%**. | Il timestamp in formato Unix si può ottenere da una shell Unix con il comando **%%date +%s%%**. | ||
+ | |||
+ | La ricezione di un check passivo viene registrata nel log **/ | ||
+ | |||
+ | < | ||
+ | [2022-02-22 02:49:04 +0100] information/ | ||
+ | Executing external command: [1645494544] PROCESS_SERVICE_CHECK_RESULT; | ||
+ | Backup Maildir; | ||
+ | rsync Maildir da Santorini a Naxos eseguito con successo. | ||
+ | </ | ||
+ | |||
+ | ==== Ricezione check passivo via REST API ==== | ||
+ | |||
+ | Si verifica che la **[[# | ||
+ | |||
+ | Nel file **/ | ||
+ | |||
+ | < | ||
+ | // Used to submit passive checks results, e.g. from backup scripts. | ||
+ | object ApiUser " | ||
+ | password = " | ||
+ | permissions = [ " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Il client che deve inviare l' | ||
+ | |||
+ | <code bash> | ||
+ | ICINGA2_SERVER=' | ||
+ | ICINGA2_USER=' | ||
+ | ICINGA2_PASSWORD=' | ||
+ | |||
+ | SERVICE_HOST=' | ||
+ | SERVICE_NAME=" | ||
+ | EXIT_STATUS=" | ||
+ | EXIT_MESSAGE=" | ||
+ | |||
+ | curl -k -s -u " | ||
+ | -H ' | ||
+ | -X POST " | ||
+ | -d '{ " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | Un servizio Icinga può essere in uno dei seguenti stati: | ||
+ | |||
+ | ^ 0 | OK | | ||
+ | ^ 1 | WARNING | ||
+ | ^ 2 | CRITICAL | ||
+ | ^ 3 | UNKNOWN | ||
==== Server NSCA ==== | ==== Server NSCA ==== | ||
+ | |||
+ | :!: **ATTENZIONE**: | ||
Nell' | Nell' | ||
Line 546: | Line 599: | ||
} | } | ||
</ | </ | ||
+ | ===== Notifica custom su Host ===== | ||
+ | |||
+ | Vediamo come predisporre le notifiche per un singolo host inviando una mail ad un determinato indirizzo. Si crea un file (ad esempio **/ | ||
+ | |||
+ | < | ||
+ | apply Notification " | ||
+ | import " | ||
+ | users = host.vars.notification.mailcustomer.users | ||
+ | times.begin = 3h | ||
+ | interval = 12h | ||
+ | assign where host.vars.notification.mailcustomer | ||
+ | } | ||
+ | |||
+ | object User " | ||
+ | import " | ||
+ | display_name = "Alert for ADSL 1" | ||
+ | email = " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Le notifiche inizieranno solo **dopo 3 ore** che l'host ha il problema, e verranno ripetute **ogni 12 ore**. Quindi è sufficiente aggiungere una riga alla definizione dell' | ||
+ | |||
+ | < | ||
+ | object Host " | ||
+ | import " | ||
+ | address = " | ||
+ | vars.notification.mailcustomer = { users = [ " | ||
+ | } | ||
+ | </ | ||
+ | |||
===== Modifica servizi predefiniti ===== | ===== Modifica servizi predefiniti ===== | ||
doc/appunti/linux/sa/cacti_122.txt · Last modified: 2022/10/10 16:27 by niccolo