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/06 15:09] – [Porta TCP alternativa per servizio standard] niccolo | doc:appunti:linux:sa:cacti_122 [2020/06/08 19:06] – [Modifica servizi predefiniti] niccolo | ||
---|---|---|---|
Line 294: | Line 294: | ||
</ | </ | ||
+ | ==== CheckCommand con parametri opzionali ==== | ||
+ | |||
+ | Si è avuto un caso particolare in cui il **server NRPE versione 2.15** (in esecuzione sull' | ||
+ | |||
+ | < | ||
+ | nrpe[9169]: Error: Could not complete SSL handshake. | ||
+ | </ | ||
+ | |||
+ | È stato necessario avviare il server NRPE con l' | ||
+ | |||
+ | < | ||
+ | object CheckCommand " | ||
+ | command = [ PluginDir + "/ | ||
+ | arguments = { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | È sufficiente definire la variabile opportuna nella sezione host: | ||
+ | |||
+ | < | ||
+ | object Host " | ||
+ | import " | ||
+ | address = " | ||
+ | vars.nrpe_swraid = " | ||
+ | vars.nrpe_no_ssl = true | ||
+ | } | ||
+ | </ | ||
===== Check passivo ===== | ===== Check passivo ===== | ||
Line 515: | Line 546: | ||
} | } | ||
</ | </ | ||
+ | ===== 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 ===== | ||
Line 595: | Line 656: | ||
===== VirtualHost con SSL ===== | ===== VirtualHost con SSL ===== | ||
+ | Per monitorare il funzionamento basico di un server web è sufficiente definire una variabile **vars.http_vhosts** in una sezione **object Host**: | ||
+ | < | ||
+ | object Host " | ||
+ | import " | ||
+ | address = " | ||
+ | vars.http_vhosts[" | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Il nome tra parentesi quadre è solo una label utilizzata per identificare il servizio nell' | ||
+ | |||
+ | Per un moderno server web tuttavia è necessario verificare la scadenza del certificato SSL ed eventualmente verificare diversi **VirtualHost** che condividono lo stesso indirizzo IP, ma hanno **ServerName** e **certificati SSL** diversi. | ||
+ | |||
+ | In teoria non sarebbe possibile **verificare il certificato SSL di un VirtualHost basato su nome**, perché nella fase iniziale della negoziazione SSL il nome dell' | ||
+ | |||
+ | Ammettendo che il server web sia configurato opportunamente, | ||
+ | |||
+ | < | ||
+ | object Host " | ||
+ | import " | ||
+ | address = " | ||
+ | vars.http_vhosts[" | ||
+ | http_address = " | ||
+ | http_vhost = " | ||
+ | http_ssl = true | ||
+ | http_sni = true | ||
+ | http_certificate = " | ||
+ | } | ||
+ | vars.http_vhosts[" | ||
+ | http_address = " | ||
+ | http_vhost = " | ||
+ | http_ssl = true | ||
+ | http_sni = true | ||
+ | http_certificate = " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Each **vars.http_vhosts** section correspond to one command invokation, of this type: | ||
+ | |||
+ | < | ||
+ | check_http -H " | ||
+ | </ | ||
===== Riferimenti Web ===== | ===== Riferimenti Web ===== |
doc/appunti/linux/sa/cacti_122.txt · Last modified: 2022/10/10 16:27 by niccolo