Monitoring Cacti

This article will help you get the Cacti plugin for sd-agent configured and returning metrics

Installing the cacti plugin package

Install the cacti plugin on Debian/Ubuntu:

sudo apt-get install sd-agent-cacti

Install the cacti plugin on RHEL/CentOS:

sudo yum install sd-agent-cacti

Read more about agent plugins.

Configuring the agent to monitor cacti

1. Create a read-only serverdensity for the Cacti database:

sudo mysql -e "create user 'serverdensity'@'localhost' identified by '$PASSWORD';"
sudo mysql -e "grant select on cacti.* to 'serverdensity'@'localhost';"

Before proceeding we reccomend that you check that the newly created has the correct permissions.

2. Configure the agent in /etc/sd-agent/conf.d/cacti.yaml

init_config:

instances:
    -   mysql_host: localhost
        mysql_user: serverdensity
        mysql_password: $PASSWORD
        rrd_path: /path/to/cacti/rra
        #field_names:
        #    - ifName
        #    - dskDevice
        #    - ifIndex
        #rrd_whitelist: /path/to/rrd_whitelist.txt

3. Grant the sd-agent user access to the RRD files:

sudo gpasswd -a sd-agent www-data
sudo chmod -R g+rx /var/lib/cacti/rra/

4. Restart the agent

sudo /etc/init.d/sd-agent restart

or

sudo systemctl restart sd-agent

Verifying the configuration
Execute info to verify the configuration with the following:

sudo /etc/init.d/sd-agent info 

or

/usr/share/python/sd-agent/agent.py info

If the agent has been configured correctly you'll see an output such as:

cacti
-----
  - instance #0 [OK]
  - Collected * metrics

You can also view the metrics returned with the following command:

sudo -u sd-agent /usr/share/python/sd-agent/agent.py check cacti

Configuring graphs

Click the name of your server from the Devices list in your Server Density account then go to the Metrics tab. Click the + Graph button on the right then choose the cacti metrics to display the graphs. The metrics will also be available to select when building dashboard graphs.

Screen_Shot_2018-01-18_at_11.46.12.png

Monitored metrics

MetricValues
cacti.hosts.count

The number of hosts monitored by Cacti
host / None
Type: float
cacti.metrics.count

The number of metrics collected from Cacti
None / None
Type: float
cacti.rrd.count

The number of Cacti RRD files
file / None
Type: float
system.disk.free.last

The amount of disk space that is free - last polling value
byte / None
Type: float
system.disk.free.max

The amount of disk space that is free - max polling value
byte / None
Type: float
system.disk.free.min

The amount of disk space that is free - min polling value
byte / None
Type: float
system.disk.used.last

The amount of disk space that is used - last polling value
byte / None
Type: float
system.disk.used.max

The amount of disk space that is used - max polling value
byte / None
Type: float
system.disk.used.min

The amount of disk space that is used - min polling value
byte / None
Type: float
system.load.1.last

The average system load over one minute - last polling value
None / None
Type: float
system.load.1.max

The average system load over one minute - max polling value
None / None
Type: float
system.load.1.min

The average system load over one minute - min polling value
None / None
Type: float
system.load.15.last

The average system load over 15 minute - last polling value
None / None
Type: float
system.load.15.max

The average system load over 15 minute - max polling value
None / None
Type: float
system.load.15.min

The average system load over 15 minute - min polling value
None / None
Type: float
system.load.5.last

The average system load over five minute - last polling value
None / None
Type: float
system.load.5.max

The average system load over five minute - max polling value
None / None
Type: float
system.load.5.min

The average system load over five minute - min polling value
None / None
Type: float
system.mem.buffered.last

The amount of physical RAM used for file buffers - last polling value
byte / None
Type: float
system.mem.buffered.max

The amount of physical RAM used for file buffers - max polling value
byte / None
Type: float
system.mem.buffered.min

The amount of physical RAM used for file buffers - min polling value
byte / None
Type: float
system.ping.latency

The system ping latency - avg polling value
millisecond / None
Type: float
system.ping.latency.max

The system ping latency - max polling value
millisecond / None
Type: float
system.proc.running.last

The number of processes running - last polling value
process / None
Type: float
system.proc.running.max

The number of processes running - max polling value
process / None
Type: float
system.proc.running.min

The number of processes running - min polling value
process / None
Type: float
system.swap.free.max

The amount of free swap space - max polling value
byte / None
Type: float
system.users.current.last

The number of logged in users - last polling value
None / None
Type: float
system.users.current.max

The number of logged in users - max polling value
None / None
Type: float
system.users.current.min

The number of logged in users - min polling value
None / None
Type: float
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Monday  —  Friday.

10am  —  6pm UK.

Dedicated Support.