1. White Star Software
  2. Advanced Alerting Configuration

Server Metrics - Telegraf

Server performance metrics (Memory, CPU, Disk I/O, Network I/O) can be collected and displayed on the ProTop portal through the collection tool Telegraf.

To view Server Metrics in graphical form, from the portal dashboard click on a resource name or right click and select Trend Data then select Server from the dashboard dropdown menu. A different selection of metrics and graphs will be displayed depending on the Operating System used by the resource.

Telegraf: Installation and Configuration

CENTOS / RHEL

1. Download Telegraf for Unix (https://portal.influxdata.com/downloads/)

2. Install Telegraf

 $ yum localinstall <downloaded package>.rpm 

3. Edit the configuration file /etc/telegraf/telegraf.conf:

Set Telegraf output url to send data to the portal influx db. Where custid1-3 are customer IDs from your etc/custid.cfg files and "(Your ProTop Portal Domain)" is the same domain from the URL you use to log into your portal:

[[outputs.influxdb]]
urls = ["http://(Your ProTop Portal Domain)/data-custid1"]

To send to multiple dbs, repeat the above:


[[outputs.influxdb]]
urls = ["http://(Your ProTop Portal Domain)/data-custid2"]
[[outputs.influxdb]]
urls = ["http://(Your ProTop Portal Domain)/data-custid3"]

Uncomment line [[inputs.linux_sysctl_fs]] so that it looks like this:
# # Provides Linux sysctl fs metrics

[[inputs.linux_sysctl_fs]]

Uncomment line [[inputs.net]] so that it looks like this:

# # Read metrics about network interface usage 

[[inputs.net]]

Uncomment and modify interfaces line. Example: interfaces = ["bond0", "bond1", "eth0", "eth1", "eth2" ]. The default interface is usually: interfaces = ["eth0"] which would look like this:

#   ## By default, telegraf gathers stats from any up interface (excluding loopback)
#   ## Setting interfaces will tell it to gather these explicit interfaces,
#   ## regardless of status.
#   ##

  interfaces = ["eth0"]

4. Set Telegraf to autostart after a reboot:

 $ chkconfig telegraf on 

5. Start Telegraf

 $ service telegraf start 

6. Execute the following command to test your configuration:

 $ telegraf --test 

The output should display something similar to the following:

TELEGRAF TEST NIX

WINDOWS

Default installation path: c:\Program files\Telegraf

Default configuration file: c:\Program files\Telegraf\telegraf.conf

1. Download Telegraf for Windows (https://portal.influxdata.com/downloads)

2. Create directory c:\Program Files\Telegraf

 C:\ > mkdir “c:\Program files\Telegraf

3. Unzip Telegraf package to C:\Program Files\Telegraf

4. Edit Telegraf configuration file (C:\Program Files\Telegraf\Telegraf.conf):

  • Set Telegraf output url to send data to portal influx db. Where custid1-3 and are customer IDs from your etc/custid.cfg files:

[[outputs.influxdb]]
urls = ["http://(Your ProTop Portal Domain)/data-custid1"]

To send to multiple dbs, repeat above:


[[outputs.influxdb]]
urls = ["http://(Your ProTop Portal Domain)/data-custid2"]
[[outputs.influxdb]]
urls = ["http://(Your ProTop Portal Domain)/data-custid3"]

5. Start Windows Command Prompt as an administrator

 C:> %windir%\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe 

6. Install Telegraf as a Service

 C:> C:\Program Files""\Telegraf\telegraf.exe --service install 

NOTE: if you are not using the default directory for the configuration file you will need to specify the file location using --config Ex:

 C:\"Program Files""\Telegraf\telegraf.exe --config C:\"Program Files""\Telegraf\telegraf.conf 

7. Start Telegraf:

 C:\> net start telegraf 

Or use Services Management Console (C:> services.msc). Refer to: https://docs.influxdata.com/telegraf/v1.11/administration/windows_service/

8. Execute the following commands to test your configuration:

 C:> cd C:\""Program Files""\Telegraf 
C:> telegraf.exe --test <--config <configuration file>>

The output should display something similar to the following:

Troubleshooting

If Telegraf is properly configured, Servers’ metrics should be displayed on ProTop’s portal ~5 minutes after Telegraf’s service is started. If no metrics are displayed check Telegraf’s log. By default, Telegraf’s logging is ‘on’ by default and collect data in C:\Program Files\telegraf\telegraf.log

Changing the LOG File

You can change default log location in telegraf.conf:

## Logging configuration:
## Run telegraf with debug log messages.
debug = false
## Run telegraf in quiet mode (error log messages only).
quiet = false
## Specify the log file name. The empty string means to log to stderr.
logfile = "/Program Files/Telegraf/telegraf.log"

Unix, log output directly to stderr :

## Logging configuration:
## Run telegraf with debug log messages.
debug = false
## Run telegraf in quiet mode (error log messages only).
quiet = false
## Specify the log file name. The empty string means to log to stderr.
logfile = ""

Restart Telegraf service: $ service telegraf restart

Common issue:

Error:

2019-08-09T18:55:41Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"[server]", Flush Interval:10s 2019-08-09T19:59:55Z E! [outputs.influxdb] when writing to [http://portal.wss.com/data-]: Post http://portal.wss.com/data-[site]/write?db=telegraf: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

Problem: Data is sent to wrong url.

Solution: Edit the config file and be sure the urls value is set to the following:

Example:

http://demo.wss.com/data-wss

or

https://demo.wss.com/data-wss