Infrastructure Integration

Configuration

  1. Create a netsil user with replication rights in your MySQL server

     sudo mysql -e "CREATE USER 'netsil'@'localhost' IDENTIFIED BY 'INSERT PASSWORD';"
     sudo mysql -e "GRANT REPLICATION CLIENT ON *.* TO 'netsil'@'localhost' WITH MAX_USER_CONNECTIONS 5;"
    
  2. If you'd like to get the full metrics catalog please also grant the following privileges:

         sudo mysql -e "GRANT PROCESS ON *.* TO 'netsil'@'localhost';"
     sudo mysql -e "GRANT SELECT ON performance_schema.* TO 'netsil'@'localhost';"
    
     mysql -u netsil --password='INSERT PASSWORD' -e "show status" | \
     grep Uptime && echo -e "\033[0;32mMySQL user - OK\033[0m" || \
     echo -e "\033[0;31mCannot connect to MySQL\033[0m"
     mysql -u netsil --password='INSERT PASSWORD' -e "show slave status" && \
     echo -e "\033[0;32mMySQL grant - OK\033[0m" || \
     echo -e "\033[0;31mMissing REPLICATION CLIENT grant\033[0m"
    
  3. Configure the agent by editing /etc/netsil-dd-agent/conf.d/cacti.yamlin the collectors.

Example:

    init_config:
    instances:
      # The Cacti checks requires access to the Cacti DB in MySQL and to the RRD
      # files that contain the metrics tracked in Cacti.
      # In almost all cases, you'll only need one instance pointing to the Cacti
      # database.
      #
      # The `rrd_path` will probably be '/var/lib/cacti/rra' on Ubuntu
      # or '/var/www/html/cacti/rra' on any other machines.
      #
      # The `field_names` is an optional parameter to specify which field_names
      # should be used to determine if a device is a real device. You can let it
      # commented out as the default values should satisfy your needs.
      # You can run the following query to determine your field names:
      #       SELECT
      #            h.hostname as hostname,
      #            hsc.field_value as device_name,
      #            dt.data_source_path as rrd_path,
      #            hsc.field_name as field_name
      #        FROM data_local dl
      #            JOIN host h on dl.host_id = h.id
      #            JOIN data_template_data dt on dt.local_data_id = dl.id
      #            LEFT JOIN host_snmp_cache hsc on h.id = hsc.host_id
      #                AND dl.snmp_index = hsc.snmp_index
      #        WHERE dt.data_source_path IS NOT NULL
      #        AND dt.data_source_path != ''
      #
      #
      #
      # The `rrd_whitelist` is a path to a text file that has a list of patterns,
      # one per line, that should be fetched. If no whitelist is specified, all
      # metrics will be fetched.
      #
      - mysql_host: localhost
        mysql_user: MYSQL_USER
        mysql_password: MYSQL_PASSWORD
        rrd_path: /path/to/cacti/rra
        # field_names:
        #   - ifName
        #   - dskDevice
        #   - ifIndex
        rrd_whitelist: /path/to/rrd_whitelist.txt
  1. Check and make sure that all yaml files are valid with following command:

    /etc/init.d/netsil-collectors configcheck
    
  2. Restart the Agent using the following command:

    /etc/init.d/netsil-collectors restart
    
  3. Execute the info command to verify that the integration check has passed:

    /etc/init.d/netsil-collectors info
    

The output of the info command should contain a section similar to the following:

    Checks
    ======
      [...]
      cacti
      ----------
          - instance #0 [OK]
          - Collected 8 metrics & 0 events

Infrastructure Datasources

Datasource Available Aggregations Unit Description
cacti.hosts.count avg max min sum host The number of hosts monitored by Cacti
cacti.metrics.count avg max min sum The number of metrics collected from Cacti
cacti.rrd.count avg max min sum file The number of Cacti RRD files
system.disk.free.last avg max min sum byte The amount of disk space that is free - last polling value
system.disk.free.max avg max min sum byte The amount of disk space that is free - max polling value
system.disk.free.min avg max min sum byte The amount of disk space that is free - min polling value
system.disk.used.last avg max min sum byte The amount of disk space that is used - last polling value
system.disk.used.max avg max min sum byte The amount of disk space that is used - max polling value
system.disk.used.min avg max min sum byte The amount of disk space that is used - min polling value
system.load.1.last avg max min sum The average system load over one minute - last polling value
system.load.1.max avg max min sum The average system load over one minute - max polling value
system.load.1.min avg max min sum The average system load over one minute - min polling value
system.load.15.last avg max min sum The average system load over 15 minute - last polling value
system.load.15.max avg max min sum The average system load over 15 minute - max polling value
system.load.15.min avg max min sum The average system load over 15 minute - min polling value
system.load.5.last avg max min sum The average system load over five minute - last polling value
system.load.5.max avg max min sum The average system load over five minute - max polling value
system.load.5.min avg max min sum The average system load over five minute - min polling value
system.mem.buffered.last avg max min sum byte The amount of physical RAM used for file buffers - last polling value
system.mem.buffered.max avg max min sum byte The amount of physical RAM used for file buffers - max polling value
system.mem.buffered.min avg max min sum byte The amount of physical RAM used for file buffers - min polling value
system.ping.latency avg max min sum millisecond The system ping latency - avg polling value
system.ping.latency.max avg max min sum millisecond The system ping latency - max polling value
system.proc.running.last avg max min sum process The number of processes running - last polling value
system.proc.running.max avg max min sum process The number of processes running - max polling value
system.proc.running.min avg max min sum process The number of processes running - min polling value
system.swap.free.max avg max min sum byte The amount of free swap space - max polling value
system.users.current.last avg max min sum The number of logged in users - last polling value
system.users.current.max avg max min sum The number of logged in users - max polling value
system.users.current.min avg max min sum The number of logged in users - min polling value