I started with a simple check from icinga documentation to check if it’s working, but I’m facing a problem.
Shortly:
Icinga2 and icingaweb are installed on ubuntu 22.04 server
|PHP Version|8.1.2-1ubuntu2.11|
|Git commit date|2023-01-26|
Icinga Web 2 Version 2.11.4
I checked the permissions on .ssh and id_rsa, id_rsa_pub and looks ok.
If I try the command from terminal:
/usr/lib/nagios/plugins/check_by_ssh -H 10.102.36.118 -l icinga -i /home/icinga/.ssh/id_rsa -C “/usr/lib/nagios/plugins/check_disk -w 80% -c 90%”
I changed my technical user for icinga because something went wrong on the icinga user profile (when i wan’t to make a normal ssh connection the cursor still blinks and nothing happened).
Right now I set the user “icnmon” to make the check on the remote client (ubuntu 22.04 server), I made the necessary ssh key generation, and ssh-copy also but I’m facing this problem:
I’d assume your icinga services at the server are still running as user icinga. Hence, the plugin will be executed as user icinga as well. And this user has obviously not enough permissions to read the identity file.
I made a VM restore when the user icinga was ok, and I tryed now with the original settings, but: " Plugin Output Remote command execution failed: Host key verification failed."
I checked and from console I can ssh with my icinga user key, and if I run a check manually is also ok.
I checked the authorized_keys file and there is additional character…
Shortly:
manually from icinga user session I can ssh to remote host with my icinga user and the associated ssh key, the command also runs fine from icinga user, the only one error I got on icinga webview.
Your icinga services are running as user nagios (which is default for Debian and Ubuntu) and you have to configure the ssh connection between nagios on server and any user on target.
You define by_ssh_arguments for the service object which are not used in your command object. Hence, check_disk is executed without any arguments and this result in the output.
Regarding an ESXI 8 customized version, here I am using the root account for the ssh from the icinga server what is working great, but the checks no, I got this message for every check:
Plugin Output
Remote command execution failed: sh: /usr/lib/nagios/plugins/check_memory: Operation not permitted
Plugin Output
Remote command execution failed: sh: /usr/lib/nagios/plugins/check_uptime: not found
The content from icinga server is copyed with scp to the client to the same folder structure, the user is root but the on the folder the permissions are 755, what can be the problem?
My hosts.conf where I set to use the root user for checks:
object Host “esxi-1” {
import “generic-host”
address = “10.102.36.11”
vars.ssh_username = “root”
vars.ssh_private_key = “/root/.ssh/id_rsa”
check_command = “hostalive”
vars.os = “Linux”
groups = [ “esxi” ]
vars.notification[“mail”] = {
groups = [ “icingaadmins” ]
}
I want to see only the cpu, disk, memory, uptime, load values and I want to use for this the most simpliest solution, for this purpose also the esxi_hardware is the best?
I comfigured the esxi_hardware check and it’s working only with root user, if I use the nagios user on the esxi server where this user have Read-Only permission I received the permission denied status, do you have mor einformation about the necessary user permission for this check?
I don’t want to grant a root privilege for a checking user…