This commit is contained in:
mwiegand 2022-08-18 02:00:30 +02:00
parent 6cdc371616
commit 9b9f443b9b
2 changed files with 10 additions and 2 deletions

View file

@ -16,7 +16,7 @@ then
exit $UNKNOWN
fi
ssh sshmon@"$SSHMON_HOST" "$SSHMON_COMMAND"
ssh sshmon@"$SSHMON_HOST" "sudo $SSHMON_COMMAND"
exitcode=$?

View file

@ -33,7 +33,8 @@ def default_check_command(metadata):
@metadata_reactor.provides(
'users/sshmon/authorized_users'
'users/sshmon/authorized_users',
'sudoers/sshmon',
)
def user(metadata):
return {
@ -44,4 +45,11 @@ def user(metadata):
}
},
},
'sudoers': {
'sshmon': {
conf['vars.command']
for conf in metadata.get('monitoring/services').values()
if conf['check_command'] == 'sshmon'
},
},
}