Skip to content

Commit b16fa8d

Browse files
authored
checkmk: change password crawling based on there docs (#6001)
* checkmk: change variable name for reserved PASSWORD * Update checkmk-install.sh * Update checkmk-install.sh * Update checkmk-install.sh
1 parent 3a2f0bf commit b16fa8d

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

install/checkmk-install.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,20 @@ motd_ssh
2424
customize
2525

2626
msg_info "Creating Service"
27-
PASSWORD=$(omd create monitoring | grep "password:" | awk '{print $NF}')
28-
$STD omd start
27+
SITE_NAME="monitoring"
28+
$STD omd create "$SITE_NAME"
29+
MKPASSWORD=$(openssl rand -base64 18 | tr -d '/+=' | cut -c1-16)
30+
31+
echo -e "$MKPASSWORD\n$MKPASSWORD" | su - "$SITE_NAME" -c "cmk-passwd cmkadmin --stdin"
32+
$STD omd start "$SITE_NAME"
33+
2934
{
30-
echo "Application-Credentials"
31-
echo "Username: cmkadmin"
32-
echo "Password: $PASSWORD"
35+
echo "Application-Credentials"
36+
echo "Username: cmkadmin"
37+
echo "Password: $MKPASSWORD"
38+
echo "Site: $SITE_NAME"
3339
} >>~/checkmk.creds
40+
3441
msg_ok "Created Service"
3542

3643
msg_info "Cleaning up"

0 commit comments

Comments
 (0)