Update node_exporter_manager.py
This commit is contained in:
@ -292,7 +292,16 @@ if __name__ == '__main__':
|
||||
sys.exit(1)
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
print("Użycie: node_exporter_manager.py --install | --update | --setup | --uninstall | --install-secured | --set-password=user:pass")
|
||||
print("""Użycie:
|
||||
node_exporter_manager.py --install # Instalacja Node Exportera
|
||||
node_exporter_manager.py --update # Aktualizacja do najnowszej wersji
|
||||
node_exporter_manager.py --uninstall # Usunięcie Node Exportera
|
||||
node_exporter_manager.py --setup # Konfiguracja automatycznych aktualizacji i logrotate
|
||||
node_exporter_manager.py --install-secured # Instalacja z TLS + Basic Auth
|
||||
node_exporter_manager.py --set-password=u:pass # Zmiana hasła basic auth (np. root:mojehaslo)
|
||||
|
||||
Uwaga: Uruchamiaj jako root!
|
||||
""")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
@ -316,9 +325,10 @@ if __name__ == '__main__':
|
||||
u, p = user_pass.split(":", 1)
|
||||
change_password(u, p)
|
||||
else:
|
||||
print("Nieznana opcja.")
|
||||
print(f"Nieznana opcja: {arg}")
|
||||
sys.exit(1)
|
||||
except Exception as e:
|
||||
logging.error(f"Błąd krytyczny: {e}")
|
||||
print(f"Wystąpił błąd: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
|
Reference in New Issue
Block a user