Monitoraggio di Ceph con Zabbix: Difference between revisions

From RVM Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 1: Line 1:
== Ceph >= Reef and Zabbix Agent 2 ==
Con Agent 2 cambia tutto in Reef


* Impostare come server zabbix anche localhost:
== Con modulo CEPH per Zabbix Agent ==
vi /etc/zabbix/zabbix_agent2.conf
 
Server=192.168.1.254,127.0.0.1
 
* Installare zabbix-get e zabbix sender su tutti i nodi:
apt install zabbix-get zabbix-sender
 
* Su un nodo ceph, abilitare il modulo restful
ceph mgr module enable restful
 
* Generare un certificato self signed:
ceph restful create-self-signed-cert
 
* Creare un API user chiamato zabbix-monitor:
 
ceph restful create-key zabbix-monitor
 
* Annotare la key, del tipo
 
export ZABBIX_KEY=a4bb2019-XXXX-YYYY-ZZZZ-abcdefghij
 
* Trovare il mgr attivo:
ceph status | grep mgr
 
* Testare l'accesso
zabbix_get -s 127.0.0.1 -k ceph.ping["https://mgr-attivo:8003","zabbix-monitor","$ZABBIX_KEY"]
 
eventualmente config in zab cond ceph sckipinsecurever
 
   Example:
 
   zabbix_get -s 127.0.0.1 -k ceph.ping["<nowiki>https://localhost:8003</nowiki>","zabbix-monitor","a4bb2019-XXXX-YYYY-ZZZZ-abcdefghij"]
 
 
Scaricare ed installare il template
 
* [https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/ceph_agent2?at=release/6.4 Browse Zabbix / Zabbix]
 
Scaricare ed installare il template
 
* [https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/ceph_agent2?at=release/6.4 Browse Zabbix / Zabbix - ZABBIX GIT / Ceph by Zabbix agent 2]
 
* [https://docs.ceph.com/en/reef/mgr/zabbix/# Zabbix Module — Ceph Documentation]
 
== Ceph < Reef and Zabbix Agent ==
Ceph, dalla versione 12 Luminous, contiene un modulo integrato per Zabbix.
Ceph, dalla versione 12 Luminous, contiene un modulo integrato per Zabbix.


Line 125: Line 78:
  sudo  tail -f /var/log/ceph/ceph-mgr.stor01.log | grep zabbix
  sudo  tail -f /var/log/ceph/ceph-mgr.stor01.log | grep zabbix


 
=== Riferimenti ===
=Riferimenti=
*[https://docs.ceph.com/en/latest/mgr/zabbix/ Zabbix Module — Ceph Documentation]
*[https://docs.ceph.com/en/latest/mgr/zabbix/ Zabbix Module — Ceph Documentation]
*[https://ceph.io/community/new-luminous-zabbix/ Ceph New in Luminous: Zabbix - Ceph]
*[https://ceph.io/community/new-luminous-zabbix/ Ceph New in Luminous: Zabbix - Ceph]
== Con Plugin Zabbix Agent 2 ==
{{Stub}}
Con Agent 2 cambia tutto, si usa il modulo Restful, che però verrà deprecato e bisogna usare l'API di Dashboard. Verificare.
* Impostare come server zabbix anche localhost:
vi /etc/zabbix/zabbix_agent2.conf
Server=192.168.1.254,127.0.0.1
* Installare zabbix-get e zabbix sender su tutti i nodi:
apt install zabbix-get zabbix-sender
* Su un nodo ceph, abilitare il modulo restful
ceph mgr module enable restful
* Generare un certificato self signed:
ceph restful create-self-signed-cert
* Creare un API user chiamato zabbix-monitor:
ceph restful create-key zabbix-monitor
* Annotare la key, del tipo
export ZABBIX_KEY=a4bb2019-XXXX-YYYY-ZZZZ-abcdefghij
* Trovare il mgr attivo:
ceph status | grep mgr
* Testare l'accesso
zabbix_get -s 127.0.0.1 -k ceph.ping["https://mgr-attivo:8003","zabbix-monitor","$ZABBIX_KEY"]
eventualmente config in zab con ceph skipinsecurever
   Example:
   zabbix_get -s 127.0.0.1 -k ceph.ping["<nowiki>https://localhost:8003</nowiki>","zabbix-monitor","a4bb2019-XXXX-YYYY-ZZZZ-abcdefghij"]
Scaricare ed installare il template
* [https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/ceph_agent2?at=release/6.4 Browse Zabbix / Zabbix]
Scaricare ed installare il template
* [https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/ceph_agent2?at=release/6.4 Browse Zabbix / Zabbix - ZABBIX GIT / Ceph by Zabbix agent 2]
* [https://docs.ceph.com/en/reef/mgr/zabbix/# Zabbix Module — Ceph Documentation]
* [https://www.reddit.com/r/ceph/comments/1ecp6rf/problem_with_restful_module/ Problem with Restful Module : r/ceph]
* [https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/410059-discussion-thread-for-official-zabbix-template-ceph Discussion thread for official Zabbix Template Ceph - ZABBIX Forums]
* [https://docs.ceph.com/en/latest/mgr/ceph_api/ Ceph RESTful API — Ceph Documentation]

Latest revision as of 13:41, 12 September 2024

Con modulo CEPH per Zabbix Agent

Ceph, dalla versione 12 Luminous, contiene un modulo integrato per Zabbix.

  • Installare su TUTTI i nodi zabbix_sender
apt install zabbix-sender

Per facilitare il debug, loggarsi poi sul nodo con il mgr in esecuzione.

  • Per trovare il manager attivo:
ceph status | grep mgr
   mgr: stor03(active), standbys: stor02, stor01
  • Attivare il debug del manager:
sudo vi /etc/ceph/ceph.conf
[mgr]
    debug mgr = 20
  • Restartare il manager:
sudo systemctl restart ceph-mgr@stor01.service
  • Verificare il log:
sudo   tail -f /var/log/ceph/ceph-mgr.stor01.log | grep zabbix
  • Abilitare il modulo:
ceph mgr module enable zabbix


  • Impostare il server zabbix o il proxy a cui inviare i dati:
ceph zabbix config-set zabbix_host zabbix.proxy.example.com
  • Impostare il nomde del cluster:
ceph zabbix config-set identifier ceph.example.priv
  • Verificare la configurazione:
ceph zabbix config-show
{"zabbix_port": 10051, "zabbix_host": "zabbix.proxy.example.com", "identifier": "ceph.example.priv", "zabbix_sender": "/usr/bin/zabbix_sender", "interval": 60}
  • Installare sul server zabbix il template corrispondente:
xclip-copyfile /usr/lib/ceph/mgr/zabbix/zabbix_template.xml
  • Oppure per le versioni più recenti:
xclip-copyfile /usr/share/ceph/mgr/zabbix/zabbix_template.xml 

  • Se si importa il nuovo template, rinominare tutte le occorrenze nel file xml con il nome della major version di Ceph, ad esempio:
%s/ceph-mgr Zabbix module/ceph-mgr pacific Zabbix module/gc
  • Creare sul server zabbix un host con nome
ceph.example.priv
  • Assegnargli il template
ceph-mgr xxx Zabbix Module
  • Inviare i primi dati:
sudo ceph zabbix discovery
sudo ceph zabbix send
  • Nel caso vedere il log:
sudo tail -f /var/log/ceph/ceph-mgr.stor01.log | grep zabbix
  • Disattivare il debug del manager:
sudo vi /etc/ceph/ceph.conf
 #[mgr]
 #   debug mgr = 20
  • Restartare il manager:
sudo systemctl restart ceph-mgr@stor01.service
  • Verificare il log:
sudo   tail -f /var/log/ceph/ceph-mgr.stor01.log | grep zabbix

Riferimenti

Con Plugin Zabbix Agent 2

Attenzione questo articolo è ancora incompleto.
Sentiti libero di contribuire cliccando sul tasto edit.

Con Agent 2 cambia tutto, si usa il modulo Restful, che però verrà deprecato e bisogna usare l'API di Dashboard. Verificare.

  • Impostare come server zabbix anche localhost:
vi /etc/zabbix/zabbix_agent2.conf
Server=192.168.1.254,127.0.0.1
  • Installare zabbix-get e zabbix sender su tutti i nodi:
apt install zabbix-get zabbix-sender
  • Su un nodo ceph, abilitare il modulo restful
ceph mgr module enable restful
  • Generare un certificato self signed:
ceph restful create-self-signed-cert
  • Creare un API user chiamato zabbix-monitor:
ceph restful create-key zabbix-monitor
  • Annotare la key, del tipo
export ZABBIX_KEY=a4bb2019-XXXX-YYYY-ZZZZ-abcdefghij
  • Trovare il mgr attivo:
ceph status | grep mgr
  • Testare l'accesso
zabbix_get -s 127.0.0.1 -k ceph.ping["https://mgr-attivo:8003","zabbix-monitor","$ZABBIX_KEY"]

eventualmente config in zab con ceph skipinsecurever

   Example:

   zabbix_get -s 127.0.0.1 -k ceph.ping["https://localhost:8003","zabbix-monitor","a4bb2019-XXXX-YYYY-ZZZZ-abcdefghij"]


Scaricare ed installare il template

Scaricare ed installare il template