8000 GitHub - urri34/LinuxInHA: Cookbook of how to take control Linux machines in HA (glances or go-hass-agent)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cookbook of how to take control Linux machines in HA (glances or go-hass-agent)

Notifications You must be signed in to change notification settings

urri34/LinuxInHA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

LinuxInHA

Usually I create and destroy Linux VM in order to make some tests or develop stuff. I want to monitor/control them from HA

Glances

If you just want to monitor the Linux machine, deeply monitor but without taking control of it, this is clearly the best option.

Installation:

apt-get install glances

Config:

Open your HA webpage, go to setting, then go to devices and services and select Glances, click ADD ENTRY and just fullfill the hostname, username and password are not necessary.

As a service:

Create a new unit by creating a file called glances.service in the /etc/systemd/system/ folder.

[Unit]
Description=Glances
After=network.target

[Service]
ExecStart=/usr/local/bin/glances -w
Restart=always
RemainAfterExit=no

[Install]
WantedBy=multi-user.target

And simply:

(as root)
systemctl enable glances.service
systemctl start glances.service

Go-hass-agent

If you want to be able to execute scripts to that machine thru HA and you dont need a deeep monitor, this is your best option.

Installation:

Visit go-hass-agent official page , where you will find detailed installation instructions.

Find your package in relases section -> At this moment was this

(as root)
wget https://github.com/joshuar/go-hass-agent/releases/download/v10.3.2/go-hass-agent_10.3.2_amd64.deb
dpkg -i go-hass-agent_10.3.2_amd64.deb
apt-get install -f
dpkg -i go-hass-agent_10.3.2_amd64.deb

Config:

Now you need some Xwindows server in order to export X11 sessions from Linux, I will say a very goos option is to install Mobaxterm. Just remember to activate X11 forwarding when configuring your ssh connection to the Linux machine.

Image

Time to start with the basic configuration, as a non root user:

(as non root user)
go-hass-agent run

Open your HA webpage, go to your profile and then security tab (http://<ha_ip>:8123/profile/security) , click create token, insert a desired name, and copy the token.

Fullfill the go-hass-agent pop-up, with the token and the http://<ha_ip>:8123

You will see lots of information in the console, everything is working fine!

Open your HA webpage, go to setting, then go to devices and services and select Movile app, here you have your Linux machine with all the sensors.

As a service:

Now lets make it a service in the linux machine:

(as root)
loginctl list-users
loginctl enable-linger
loginctl list-users
(as non root user)
systemctl --user enable go-hass-agent
systemctl --user start go-hass-agent
systemctl --user status go-hass-agent

About

Cookbook of how to take control Linux machines in HA (glances or go-hass-agent)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0