Bes0n
(BesOn)
October 30, 2020, 3:57pm
1
Hello CheckMK community,
I would like to ask you about Passwords management module. Is there a possibility to add stored password in your custom check.
For instance I’ve got a passwords in Passwords tab provided by CheckMK. Now I would like to call it from check:
python3.6 $USER2$/redfish/check_redfish.py -H $HOSTADDRESS$ --storage
This script supports -u user -p password option, but I have no idea how should I call a Password stored in CheckMK Passwords tab.
Thank you in advance.
Regards,
BesOn
athomaidis
(anastasios)
October 30, 2020, 10:52pm
2
Hi Beson,
there is a module for password store in Checkmk.
You can use this module inside your custom extension. There are also examples for using it.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
"""This module is meant to be used by components (e.g. active checks, notifications, bakelets)
that support getting credentials from the Check_MK password store.
The module needs to be included and then the script needs to run the
replace_passwords() function. This should be done early in the script
to make the pwstore option handling transparent for the script.
Do it like this:
import cmk.utils.password_store
cmk.utils.password_store.replace_passwords()
"""
import sys
This file has been truncated. show original
BR
Anastasios
2 Likes
Bes0n
(BesOn)
November 2, 2020, 9:41am
3
athomaidis:
Anastasios
Hi Anastasios,
Thank you for your reply and provided information. I will try it.
1 Like
system
(system)
Closed
November 2, 2021, 9:41am
4
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.