Linux
SAYMON Agent for Linux is distributed as an installation script as well as a package for Ubuntu/Debian and Red Hat/Fedora package managers. Both of these installation methods don’t require an internet connection.
Examples in this articles download installation scripts and packages with a separate command using wget
. To install SAYMON Agent on the host without internet access, download agent installers beforehand and manually transfer them to the host you intend to use.
Both installation methods support automatic updates.
The user saymon
is automatically created in the system during agent installation. The agent works as this user.
If there is already such a user in the system, the agent will use it instead.
After the installation the service saymon-agent
is enabled.
Install using script
To install the agent using the installation script, obtain the script for the agent version you need and execute it on the host:
$wget https://downloads.cpult.ru/agent/v5.1.1/saymon-agent-5.1.1-linux-x64-installer.sh
$sudo sh saymon-agent-5.1.1-linux-x64-installer.sh
There are separate installation scripts for each system architecture. When you install an agent with the wrong script, the installation will proceed as normal, but the service will not work. You can fix the corrupt installation by updating it with the installation script for the correct architecture. |
When you execute the installation script, it will show you an interactive menu, where you can select the configuration generation option or cancel the install:
Unpacking the distribution archive... OK
Please select how you want to configure SAYMON Agent:
1) Manual configuration.
2) Auto configuration.
3) Quit without installing.
-
Stop the script without installing the agent.
If the script detects installed agent in the /opt/saymon-agent
folder, the script will ask if you want to update the agent instead. You can find instruction on how to install a second instance of the agent on the same host on the Extra agents installation page.
Manual configuration
When you install an agent using manual configuration, the script will ask you to enter the agent ID and the address of the server where the agent needs to be registered. After this, the script will unpack the archive with the agent into the /opt/saymon-agent
directory, creates the saymon
user and saymon
group, and enable saymon-agent
in the systemd
.
Unpacking the distribution archive... OK
Please select how you want to configure SAYMON Agent:
1) Manual configuration.
2) Auto configuration.
3) Quit without installing.
Your choice: 1
Please enter agent ID (leave empty or enter 0 for agent ID auto registration): 5e21b752308c3c66d64e072c
SAYMON Agent ID set to '5e21b752308c3c66d64e072c'.
Please enter SAYMON Server address (IP or hostname): 192.168.1.45
SAYMON Server address set to '192.168.1.45'.
Created 'saymon' user group with GID 11813.
Created 'saymon' user with UID 11813.
SAYMON Agent installed to /opt/saymon-agent.
Systemd detected.
SAYMON Agent systemd service installed and enabled.
Start SAYMON Agent service.
SAYMON Agent installation completed.
Auto configuration
When you install an agent using automatic configuration, the script will unpack the archive with the agent into the /opt/saymon-agent
directory, creates the saymon
user and saymon
group, enable saymon-agent
in the systemd
. It will also create a standard configuration file, that is set up for automatic agent registration on the server located at 127.0.0.1
. Server address can be changed after installation.
Unpacking the distribution archive... OK
Please select how you want to configure SAYMON Agent:
1) Manual configuration.
2) Auto configuration.
3) Quit without installing.
Your choice: 2
SAYMON Agent will be installed with agent ID auto registration enabled and default SAYMON server address.
Please edit /opt/saymon-agent/conf/agent.properties if you want to change these settings later.
SAYMON Agent ID set to '0'.
Created 'saymon' user group with GID 11813.
Created 'saymon' user with UID 11813.
SAYMON Agent installed to /opt/saymon-agent.
Systemd detected.
SAYMON Agent systemd service installed and enabled.
Start SAYMON Agent service.
SAYMON Agent installation completed.
When you use the auto configuration option, the script will generate the following configuration file:
#
# SAYMON Agent configuration file.
#
# Value 0 means SAYMON Agent will attempt to register on server automatically.
agent.id=0
# Secure connection to SAYMON Server. Enabled by default.
server.secure=false
# SAYMON Server address.
server.host=127.0.0.1
# server.port=9092
# Network hosts discovery.
agent.discoveryEnabled=false
# Allows SAYMON Agent to execute custom shell scripts.
agent.scriptsEnabled=true
# SNMP traps receiver.
agent.snmpTrapEnabled=false
# USM username, authentication and privacy password should be 8+ characters long.
# agent.snmpTrapUsmUser=
# agent.snmpTrapUsmAuthenticationPassword=
# agent.snmpTrapUsmPrivacyPassword=
Install using package manager
To install the agent using package managers you need to get a package for your system’s package manager (.deb
for Debian/Ubuntu systems and .rpm
for Red Hat/Fedora) and install it on the host you intend to use for agent:
-
deb
-
rpm
$wget https://downloads.cpult.ru/agent/v5.1.1/saymon-agent_5.1.1-cd6973ea_amd64.deb
$sudo dpkg -i saymon-agent_5.1.1-cd6973ea_amd64.deb
$wget https://downloads.cpult.ru/agent/v5.1.1/saymon-agent-5.1.1-cd6973ea.x86_64.rpm
$sudo dnf install saymon-agent-5.1.1-cd6973ea.x86_64.rpm
When you successfully install packages, the console will show the following output:
-
deb
-
rpm
Selecting previously unselected package saymon-agent.
(Reading database ... 37334 files and directories currently installed.)
Preparing to unpack saymon-agent_5.1.1-cd6973ea_amd64.deb ...
passwd: password changed.
Unpacking saymon-agent (5.1.1-cd6973ea) ...
Setting up saymon-agent (5.1.1-cd6973ea) ...
You can configure /opt/saymon-agent/conf/agent.properties
Backup directory /opt/saymon-agent.backup found. Also you can restore the configuration from there.
And restart the service
sudo systemctl restart saymon-agent
Start the service
Created symlink /etc/systemd/system/multi-user.target.wants/saymon-agent.service → /etc/systemd/system/saymon-agent.service.
Last metadata expiration check: 0:13:14 ago on Tue 06 Aug 2024 03:36:47 PM MSK.
Dependencies resolved.
==============================================================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================================================
Installing:
saymon-agent x86_64 5.1.1-cd6973ea @commandline 90 M
Transaction Summary
==============================================================================================================================================================================
Install 1 Package
Total size: 90 M
Installed size: 186 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: saymon-agent-5.1.1-cd6973ea.x86_64 1/1
passwd: password changed.
Installing : saymon-agent-5.1.1-cd6973ea.x86_64 1/1
Running scriptlet: saymon-agent-5.1.1-cd6973ea.x86_64 1/1
You can configure /opt/saymon-agent/conf/agent.properties
Backup directory /opt/saymon-agent.backup found. Also you can restore the configuration from there.
And restart the service
sudo systemctl restart saymon-agent
Start the service
Created symlink /etc/systemd/system/multi-user.target.wants/saymon-agent.service → /etc/systemd/system/saymon-agent.service.
Installed:
saymon-agent-5.1.1-cd6973ea.x86_64
Complete!
Agent registration
Once the agent is registered on the server, a new object of the Saymon Agent class is created. The ID of the created object (agentId) is passed to the agent. A registration.json file (/opt/saymon-agent/storage
) containing this identifier is created on the host with the agent.
To repeat the procedure for obtaining agentId (for example, if you need to connect the agent to another server), delete registration.json and restart the agent service.
Log files
By default, agent log files are saved to the /var/log/saymon
directory.
If necessary, you can enable centralized agent logging with SYSLOG in the file /opt/saymon-agent/conf/logback-upstart.xml
.