Help Admin Adding a monitor Add a Linux Monitor

Add a Linux Monitor

Install the Linux monitoring agent to monitor the performance and usage of your Linux servers. Monitor and measure critical metrics like CPU, memory, disk utilization, processes and network traffic of Linux servers from a unified dashboard. Site24x7 uses the server monitoring agent to collect performance data from your servers.

Supported Linux Flavors:

Debian, Ubuntu, CentOS, RedHat, Madriva, Fedora, Suse, Amazon Linux, Gentoo, CoreOS, RancherOS, Raspberry Pi (requires Python 2.7 and above), ARM Processor (requires Python 2.7 and above). For other flavors apart from the ones listed here, Python 2.7 and above is required and the same installation procedure can be followed.

How Can I...

Other Features...

Add a Linux Monitor

  1. Log in to Site24x7 and go to Server > Server Monitor > Servers (+) > Linux. You can also navigate via Admin Inventory Add Monitor > Linux Server Monitoring.
  2. Use the toggle button to install the agent as root or non root, and run the agent as root or non root after installation.
    For eg: To install the agent as a root user and run the agent as non root with proxy enabled, execute the following command:
    wget https://staticdownloads.site24x7.com/server/Site24x7InstallScript.sh
    bash Site24x7InstallScript.sh -i -key=<device key> -proxy=user:password@proxyhost:proxyport -s24x7-agent
    Learn more on the differences between root and non root installations.
  3. Click on Copy to Clipboard to copy-paste the commands and execute them to download and install the Linux agent. The command given is independent of the OS architecture: 32-bit or 64-bit. 

Once the agent is installed, you can view the monitor under Server > Server Monitor > Servers.

You can also associate configuration profiles including threshold, resource check, notification profiles during agent installation itself.

Having trouble installing the agent? Try with an alternative method mentioned in the below section.

Alternative Method to Install Agent

Execute the following commands in the Linux terminal depending on whether the OS is 32-bit or 64-bit. Use the Device Key to authenticate the installation of the Linux agent.

  1. [64-bit:] 
    sudo wget https://staticdownloads.site24x7.com/server/Site24x7_Linux_64bit.install
    sudo chmod 755 Site24x7_Linux_64bit.install
    sudo ./Site24x7_Linux_64bit.install -i -key=<DEVICE_KEY>

    To install the agent using organizational proxy:
    sudo wget https://staticdownloads.site24x7.com/server/Site24x7_Linux_64bit.install
    sudo chmod 755 Site24x7_Linux_64bit.install 
    sudo ./Site24x7_Linux_64bit.install -i -key=<DEVICE_KEY> -proxy=user:password@proxyhost:proxyport
    or
    sudo ./Site24x7_Linux_64bit.install -i -key=<DEVICE_KEY> -proxy=host:port
  2. [32-bit:]
    sudo wget https://staticdownloads.site24x7.com/server/Site24x7_Linux_64bit.install
    sudo chmod 755 Site24x7_Linux_32bit.install
    sudo ./Site24x7_Linux_32bit.install -i -key=<DEVICE_KEY>

    To install the agent using organizational proxy:
    sudo wget https://staticdownloads.site24x7.com/server/Site24x7_Linux_64bit.install
    sudo chmod 755 Site24x7_Linux_32bit.install 
    sudo ./Site24x7_Linux_32bit.install -i -key=<DEVICE_KEY> -proxy=user:password@proxyhost:proxyport
    or
    sudo ./Site24x7_Linux_32bit.install -i -key=<DEVICE_KEY> -proxy=host:port

Restart the Linux Agent

Execute the below commands based on the user type:

Root user:

sudo /etc/init.d/site24x7monagent restart

Non root user:

<home_dir_of_user_who_installed_the_agent>/site24x7/monagent/bin/monagent restart 

Edit/Modify Existing Linux Monitors

  1. Log in to Site24x7 and go to Server > Server Monitor > Servers > click on the Linux server monitor you wish to edit.
  2. Beside the display name, hover on the hamburger icon and click Edit.
  3. Edit and change the display name, monitor group, dependency on monitor, threshold and availaibility profile, notification profile, user groups, tags, resource check profiles and more.
    The Host Name, IP address and Associated Configuration Template are also listed. These fields cannot be edited.
  4. Set the Poll Interval i.e. select the frequency for data collection. You can choose from a range of 1 min, 5 min, 10 mins, 15 mins, 30 mins, 1 hour, 3 hours, 6 hours, 12 hours, and one day. Read on to find out how to edit the frequency interval.
  5. Use the toggle button to enable or disable Syslog Monitoring. Once an option is chosen and changes are saved, the agent will restart the syslog service.  
  6. Integrate new or remove existing Third Party Integrations from Site24x7 alarms. 
  7. Save your changes. 

Uninstall the Linux Agent

Execute the below commands based on the user type:

Root user:

sudo /opt/site24x7/monagent/bin/uninstall

Non root user:

<home_dir_of_user_who_installed_the_agent>/site24x7/monagent/bin/uninstall

Bulk Installation Methods

Add the Linux Monitoring Agent via Google Cloud Platform (GCP)

  1. Log in to the Google Cloud Platform (GCP) console. Click on Compute Engine.
  2. In the Compute Engine page, click on Create Instance.
  3. Scroll down and click on Management, security, disks, networking, sole tenancy.
  4. Under Automation, paste the following in the Startup Script text box. Replace the DEVICE_KEY parameter with the key given in the Site24x7 web client. Learn more.
    bash -c "$(curl -sL https://staticdownloads.site24x7.com/server/Site24x7InstallScript.sh)" readlink -i -key=<DEVICE_KEY>
  5. Click Create. The agent will be installed in your GCE instace.

Add the Linux Monitoring Agent via DigitalOcean User Interface

  1. Log in to your DigitalOcean user interface.
  2. Click on Create > Droplets.
  3. Under Select Additional Options, check the option User Data.
  4. Copy and paste the following in the User Data text box. Replace the DEVICE_KEY parameter with the key given in the Site24x7 web client. Learn more.
    #cloud-config
    runcmd:
    - bash -c "$(curl -sL https://staticdownloads.site24x7.com/server/Site24x7InstallScript.sh)" readlink -i -key=<DEVICE_KEY>

The agent will be installed in your DigitalOcean Droplet. You can also use APIs to install the agent. Learn more.  

Install the Linux Agent while Launching an Amazon Machine Image

Use any of the following methods to install the Linux agent via an Amazon Machine Image:

Launching an already Created Amazon Machine Image (AMI) via EC2 Management Console:

  1. Download and save the file InstallSite24x7LinuxAgent.sh in your local machine.
  2. Edit the script file to include your device key in DEVICE_KEY="""
  3. Log in to your EC2 management console and navigate to Request Instances Wizard > Instance Details > User Data.
  4. Click the Browse option and upload the InstallSite24x7LinuxAgent.sh file that is saved in your local disk.
  5. Proceed with the AMI launching instance.

Creating a New Amazon Machine Image:
/etc/rc.local is the script file that is always called during the boot time of a Linux server. Adding the following script in the /etc/rc.local file will trigger installation of Site24x7 Linux agent, when the new instance boots.
[64-bit:AMI]

if [ ! -f /etc/init.d/site24x7monagent ]; then
wget https://staticdownloads.site24x7.com/server/Site24x7_Linux_64bit.install
chmod 755 Site24x7_Linux_64bit.install
./Site24x7_Linux_64bit.install -i -key=<DEVICE_KEY>
fi

[32-bit:AMI]

if [ ! -f /etc/init.d/site24x7monagent ]; then
wget https://staticdownloads.site24x7.com/server/Site24x7_Linux_64bit.install
chmod 755 Site24x7_Linux_32bit.install
./Site24x7_Linux_32bit.install -i -key=<DEVICE_KEY>
fi

Installing the Agent during AWS Autoscaling:
Autoscaling allows you to scale your Amazon EC2 capacity according to the conditions defined by you. When additional resources are allocated, you can choose to install Site24x7 Linux agent in the additional resources. Follow the steps below:

    1. Download and save the file InstallSite24x7LinuxAgent.sh in your local machine.
    2. To create launch configuration:
      as-create-launch-config <CONFIG_NAME> --image-id <AMI_ID> --instance-type <INSTANCE_TYPE> --user-data-file InstallSite24x7LinuxAgent.sh
      For example
      as-create-launch-config TestLaunchConfig --image-id ami-bd4ed56f --instance-type t1.micro --user-data-file InstallSite24x7LinuxAgent.sh
    3. To update autoscaling group:
      as-update-auto-scaling-group <GROUP_NAME> --launch-configuration <CONFIG_NAME>
      For example
      as-update-auto-scaling-group TestAutoScalingGroup --launch-configuration TestLaunchConfig
    4. Scaling down in AWS

      If an integrated EC2 instance is stopped/terminated by an autoscaling group, both the EC2 instance and the server agent won't alert it as Down

Agent Installation via AWS templates:
In AWS CloudFormation, applications can be launched via templates associated to AMIs. To install the Site24x7 Linux agent, add the following as part of UserData to the template used for launching applications:

"UserData" :{
"Fn::Base64" : {
"Fn::Join" : [ ",", [
"#!/bin/bash\n",
"sudo wget https://staticdownloads.site24x7.com/server/Site24x7_Linux_64bit.install\n",
"sudo chmod 755 Site24x7_Linux_64bit.install\n",
"sudo ./Site24x7_Linux_64bit.install -i -key=<DEVICE_KEY>\n"]]
}
}

Installation via AWS Command Line Interface (CLI):

  1. Download and save the file InstallSite24x7LinuxAgent.sh in your machine.
  2. Edit the script file to include your device key in DEVICE_KEY=""
  3. Run the following command in your CLI:
    ec2-run-instances --key KEYPAIR --user-data-file InstallSite24x7LinuxAgent.sh ami-bf5eb9d6
    For instructions on how to install AWS CLI, refer here.

Add the Linux Monitoring Agent using AWS Elastic Beanstalk

  1. Create a folder named .ebextensions in the root folder of your application source bundle.
  2. Inside the .ebextensions folder, execute the following command after replacing the <device key> with the device key given in the Site24x7 web client:
    echo -e 'commands:
    # Download site24x7-server-agent install script
         "01-agent-script-download":
             command: sudo curl -o /etc/Site24x7InstallScript.sh https://staticdownloads.site24x7.com/server/Site24x7InstallScript.sh
    # Install site24x7-server-agent in ebs instance
         "02-install-site24x7-server-agent":
             command: bash /etc/Site24x7InstallScript.sh -i -key=<device key> -automation=true -installer=aws_ebs' >> site24x7-linux-agent.config
  3. Deploy your application with either Elastic Beanstalk Console, EB CLI, or AWS CLI.

Resource Check Profiles

Resource check profiles can be used to monitor internal resources like files, directories, and syslogs. The resources to be monitored should be added as checks to a resource check profile and this profile can be associated to any number of server monitors. You can also edit or delete a resource check profile.  

A profile that is associated with a server monitor cannot be deleted, it can only be edited. Being an irreversible action, caution must be taken before deleting the profile.

IT Automation

Reduce manual intervention and bring in an automated workflow to take action during an alert event. Add an automation

Configuration Rules

Configuration templates have been deprecated. Use Configuration Rules to create better pre-defined actions and automate the configuration settings of your monitoring resources.

Plugin Integrations

Monitor your entire IT stack with our ready-to-use plugin integrations or write your own plugin using Python or Shell scripts. Configure thresholds and be notified when the set value exceeds. 

Associate Configuration Profiles during Agent Installation

You can associate configuration profiles (like threshold, resource, notification profiles and group/display name) during the installation of the Linux agent itself. Read a use case to know how this works.

Security

The Linux server monitoring agent is written in Python and has two components: the Site24x7Agent and the Site24x7AgentWatchdog that run as two separate processes.

A root user or a non root user can install the Linux agent. Once the agent is installed, the user can opt to run the site24x7-agent as root or non root. The agent is stored in the location,

  • /opt/site24x7/monagent for root
  • <home_dir_of_user_who_installed_the_agent>/site24x7/monagent for non root

Collection of performance data:

Performance data is collected using shell commands like top, free, df, ps etc. Configuration data including the the agent device key (for authorization purposes) and proxy details are encrypted and stored in the agent configuration file. It is stored in the location

  • /opt/site24x7/monagent/conf/monagent.cfg for root
  • <home_dir_of_user_who_installed_the_agent>site24x7/monagent/conf/monagent.cfg for non root

Applications Monitoring:

Once the Linux agent is installed, docker containers are auto-discovered and marked up for monitoring. If you wish to monitor only your servers, this option can be disabled. Learn more.

Troubleshooting Tips

For more FAQs, refer here.

Licensing

A Linux server monitor is a basic monitor. Know the performance metrics provided for one Linux monitor

Related Articles

Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.

Help Admin Adding a monitor Add a Linux Monitor