Extra agents installation

During work with the system it may became necessary to monitor one host on several SAYMON servers. Since one agent can work with only one server, in this case it is necessary to install and set up on the host an extra agent for each extra server.

Extra agents and checks they conduct demand extra resources from the host.

Linux

Agent copy creation

  1. Copy the directory /opt/saymon-agent, for example, to /opt/saymon-agent-2:

    $ sudo cp -r /opt/saymon-agent /opt/saymon-agent-2
  2. Change the owner of the created directory:

    $ sudo chown saymon:saymon /opt/saymon-agent-2
  3. Delete all contents of the folder /opt/saymon-agent-2/storage:

    $ sudo rm -rf /opt/saymon-agent-2/storage
  4. In the file /opt/saymon-agent-2/conf/agent.properties set up the new agent:

    $ sudo nano /opt/saymon-agent-2/conf/agent.properties
  5. In the logging settings files replace everywhere saymon-agent with saymon-agent-2.

    $ sudo nano /opt/saymon-agent-2/conf/logback.xml
    $ sudo nano /opt/saymon-agent-2/conf/logback-upstart.xml

Copying script of service launch

  1. Copy the file /etc/systemd/system/saymon-agent.service, for example, to /etc/systemd/system/saymon-agent-2.service:

    $ sudo cp /etc/systemd/system/saymon-agent.service /etc/systemd/system/saymon-agent-2.service
  2. In the new file /etc/systemd/system/saymon-agent-2.service replace the following lines:

    Environment=SAYMON_AGENT_LOGBACK_CONFIGURATION_FILE=/opt/saymon-agent/conf/logback-upstart.xml
    WorkingDirectory=/opt/saymon-agent
    ExecStartPre=/bin/bash -ec "/opt/saymon-agent/saymon-agent-updater.sh > /var/log/saymon/saymon-agent-updater.out 2>&1"
    ExecStart=/opt/saymon-agent/saymon-agent.sh > /var/log/saymon/saymon-agent.out 2>&1

    with:

    Environment=SAYMON_AGENT_LOGBACK_CONFIGURATION_FILE=/opt/saymon-agent-2/conf/logback-upstart.xml
    WorkingDirectory=/opt/saymon-agent-2
    ExecStartPre=/bin/bash -ec "/opt/saymon-agent-2/saymon-agent-updater.sh > /var/log/saymon/saymon-agent-2-updater.out 2>&1"
    ExecStart=/opt/saymon-agent-2/saymon-agent.sh > /var/log/saymon/saymon-agent-2.out 2>&1

Launching the agent

Run the commands for activation and launching the new agent service in the terminal:

$ sudo systemctl enable saymon-agent-2
$ sudo service saymon-agent-2 start

Windows

Agent copy creation

  1. Copy the agent directory ( C:\Program Files (x86)\SAYMON Agent by default), for example, to C:\Program Files (x86)\SAYMON Agent 2.

  2. Delete all contents of the folder C:\Program Files (x86)\SAYMON Agent 2\storage.

  3. In the file C:\Program Files (x86)\SAYMON Agent 2\conf\agent.properties set up the new agent.

New agent service installation

  1. In the file C:\Program Files (x86)\SAYMON Agent 2\saymon-agent.xml replace the lines:

    <id>saymon-agent</id>
    <name>SAYMON Agent</name>
    <description>SAYMON Agent</description>

    with:

    <id>saymon-agent-2</id>
    <name>SAYMON Agent 2</name>
    <description>SAYMON Agent 2</description>
  2. Run the command line as administrator.

  3. Go to the directory C:\Program Files (x86)\SAYMON Agent 2:

    $ cd "C:\Program Files (x86)\SAYMON Agent 2"
  4. Install and launch the new agent service with following commands:

    $ saymon-agent.exe install
    $ saymon-agent.exe start