Check_by_ssh & sudo

I can’t figure out how to define a service for using check_by_ssh and calling a script that needs to be run with root privileges. Does anybody here use such an approach and can show an example?

Thanks in advance!

Hi,

quick shot:

  vars.by_ssh_command = [ "sudo", "tail", "/var/log/messages" ]

?

Cheers,
Michael

2 Likes

Oh, that could be an array as well. Excellent!

1 Like