Password Store und aktive checks

Hallo zusammen,

im Wato ( 1.6.0p9 ) kann ich ja Passworte speichern

Wie kann ich in klassischen aktiven Checks auf die Passworte zugreifen?
Gibt es da eine Variable/Macro das ich verwenden kann?

Gruß
Jörg

Dies dürfte nur einfach gehen wenn der aktive Check in Python geschrieben ist.
Ich kann mich erinnern, dass die active Checks “check_sql” und “check_mail_loop” die Funktion haben Passwörter aus dem Store zu verwenden.
Sind aber halt beides Python Scripte.
Die haben beide am Anfang halt als Import die Python Libs stehen welche den Passwort Store implementieren.

1 Like

In addition to Andreas answer, the python module to be used by active checks that support getting credentials from the Check_MK password store can be found under:

$OMD_ROOT/lib/python/cmk/password_store.py

To use this in your script, you need to do this:

import cmk.password_store
cmk.password_store.replace_passwords()

And then while setting up the active checks, specify this as the argument

# --pwstore=4@4@web,6@0@foo
#  In the 4th argument at char 4 replace the following bytes
#  with the passwords stored under the ID 'web'
#  In the 6th argument at char 0 insert the password with the ID 'foo'

# Extract first argument and parse it
2 Likes

Danke Andreas, Thanks Marco!

Also kein einfaches macro für den Zugriff auf den PW Store.

Danke!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.