Skip to main content

CactiDB Adapter.

Project description

Cactidbadapter is a utility tool of python for network operators and Cacti users. Network operators and administrators sometimes needs to get registered data from Cacti database. This module can get easily devices and fetched snmp polling value. Latest Version


  • Python2.7, 3.4, PyPy.


Get from PyPI

$ pip install cactidbadapter

Get from Github

$ git clone
$ cd cactidbadapter
$ python install

Using example

Example for get_host().

>>> from cactidbadapter import CactiDBAdapter
>>> cacti = CactiDBAdapter(database='cacti',
...                        user='admin',
...                        password='*****',
...                        port=3306)
>>> cacti.get_host()
[{'hostname': '', 'id': 1, 'description': 'Localhost'}]

Example for get_host() hostname and description columns.

>>> cacti.get_host(columns=('hostname', 'description',))
[{'hostname': '', 'description': 'Localhost'}]

Example for get_host() all columns.

>>> cacti.get_host(columns=('*',))
[{'hostname': '', 'id': 1, 'description': 'Localhost', 'snmp_version': 2, 'snmp_timeout': 500, ... }]

Example for get_host() all columns and limit 1.

>>> cacti.get_host(columns=('*',), limit=1)
[{'hostname': '', 'id': 1, 'description': 'Localhost', 'snmp_version': 2, 'snmp_timeout': 500, ... }]

Example for show host table columns.

>>> cacti.host_columns()
['availability', 'availability_method', 'avg_time', 'cur_time', 'description', ... ]

Other sample is here.

SNMP system values

Cacti doesn’t have system informations with default. If you need system values (sysDescr, sysNaem, sysUpTime …), then you install “system.xml”.

  1. For Debian/Ubuntu

    sudo cp utils/cacti/system.xml /usr/share/cacti/resource/snmp_queries/
  2. Add Data Queries

    Name: SNMP - Get System Information
    Description: SNMP System Information
    XML Path: <path_cacti>/resource/snmp_queries/system.xml
    Data Input Method: Get SNMP Data (Indexed)
  3. Add Host Templates

    "Left menu" > "Host Templates" > YOUR_TEMPLATE_NAME > "Associated Data Queries" > Add
    "Add Data Query": "SNMP - Get System Information" # Select and Add.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
cactidbadapter-0.1.2.tar.gz (5.5 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page