Didactum monitoring devices and sensors – integration into Cacti
This guide describes the complete integration of Didactum monitoring devices into Cacti. The objective is the long-term graphical recording and visualization of all sensor values - temperature, humidity, leakage, voltage, door contacts, and others - via the SNMP protocol. Cacti stores these measurement values in RRDs (Round Robin Databases) and automatically generates time-series graphs from them.
1. Fundamentals and Architecture
Cacti is a network-based graphing tool primarily designed for the long-term visualization of measured values. In contrast to Nagios, the focus is not on alerting but on the historical analysis of trends – e.g., temperature development over weeks and months.
Data Flow in Cacti
- The Cacti poller queries OID values from the Didactum device via SNMP at configurable intervals (default: 5 minutes).
- The raw values are stored in an RRD file (Round Robin Database). Older values are automatically consolidated (averages, maximum, minimum).
- Cacti generates time series graphs from the RRD data using rrdtool graph.
- Thresholds can be monitored and notifications triggered via the threshold plugin.
Cacti Components Overview
| Component | Function |
|---|---|
| Poller (poller.php) | Executes SNMP queries, runs via cron every 5 minutes |
| RRDtool | Stores time series data, automatically consolidates old values |
| Data Source | Defines which OID is queried and into which RRD file it is written |
| Graph Template | Specifies how the data is displayed graphically (lines, colors, labels) |
| Device | Represents a network device (e.g., the Didactum device) with IP and SNMP settings |
| Data Query | Automatic detection of all sensors of a device via SNMP tables |
| Threshold Plugin | Monitors thresholds and sends notifications when they are exceeded |
2. Prerequisites
- Cacti 1.2.x or newer (latest stable version recommended)
- Linux server (Debian/Ubuntu or RHEL/CentOS) with root access
- PHP 7.4 or newer, Apache/Nginx, MariaDB/MySQL
- RRDtool 1.7 or newer
- SNMP tools (snmp, snmpd) on the Cacti server
- Didactum monitoring device reachable on the network, SNMP enabled
- UDP port 161 open from the Cacti server to the Didactum device
- Optional: Cacti plugins Threshold, Thold and Monitor for alerting
Example Network Configuration
| Device | IP Address | Role |
|---|---|---|
| Cacti Server | 192.168.1.30 | Monitoring and graphing server |
| Didactum Monitoring Unit | 192.168.1.100 | Monitored device (SNMP agent) |
3. SNMP Preparation on the Didactum Device
3.1 Enable SNMP
- Open the Didactum web interface: [http://192.168.1.100](http://192.168.1.100), log in with the admin account.
- Navigation: Settings → Network → SNMP (or: Settings → Network → SNMP).
- Set the following parameters:
- SNMP enabled: Yes
- SNMP version: v2c (recommended for Cacti) or v3
- Community string: public (change in production)
- SNMP port: 161
- Allowed managers: enter the IP of the Cacti server (192.168.1.30)
- Save the settings.
3.2 Test connectivity from the Cacti server
# SNMP walk – list all Didactum OIDs: snmpwalk -v2c -c public 192.168.1.100 1.3.6.1.4.1.3854 # Query temperature sensor 1 directly: snmpget -v2c -c public 192.168.1.100 1.3.6.1.4.1.3854.1.2.2.1.16.1.3.1 # All temperature sensors as a table: snmpwalk -v2c -c public 192.168.1.100 1.3.6.1.4.1.3854.1.2.2.1.16.1.3
Note:
Didactum returns temperature and voltage values with a factor of 10 (235 = 23.5°C). This must be taken into account in the Cacti data sources.
4. Install and Prepare Cacti
4.1 Install Cacti on Debian/Ubuntu
# Install dependencies: sudo apt update sudo apt install cacti cacti-spine rrdtool snmp snmp-mibs-downloader php-snmp -y # During installation: configure database password and web server (Apache). # Cacti will then be accessible at: <SERVER-IP>/cacti
4.2 Install Cacti on RHEL / CentOS / Rocky Linux
# Enable the EPEL repository: sudo dnf install epel-release -y # Install Cacti and dependencies: sudo dnf install cacti rrdtool net-snmp net-snmp-utils php-snmp -y # Start Apache and MariaDB: sudo systemctl enable --now httpd mariadb
4.3 Set up a cron job for the poller
# Open the crontab for the Cacti user: sudo crontab -u www-data -e # Add the following entry (polling every 5 minutes): */5 * * * * php /usr/share/cacti/poller.php > /dev/null 2>&1
4.4 Configure the Spine poller (recommended for many devices)
Spine is a faster C-based poller than the standard PHP poller and is recommended for production environments:
sudo nano /etc/cacti/spine.conf
DB_Host 127.0.0.1 DB_Database cacti DB_User cactiuser DB_Pass cactipassword DB_Port 3306 Threads 5 Timeout 400 PHP_Path /usr/bin/php
In Cacti, enable it: Console → Configuration → Settings → Poller → Poller Type: Spine.
4.5 Integrate the Didactum MIB file
# Copy the MIB file to the SNMP directory: sudo cp DIDACTUM-RACKMONI2-MIB.mib /usr/share/snmp/mibs/ # Add to /etc/snmp/snmp.conf: echo "mibs +DIDACTUM-RACKMONI2-MIB" | sudo tee -a /etc/snmp/snmp.conf # Test: snmpget -v2c -c public -m +DIDACTUM-RACKMONI2-MIB 192.168.1.100 tempValue.1
Note:
The name of the .mib file may vary. Please check on the device and adjust the script accordingly!
5. Create Didactum Device in Cacti
5.1 Create a new device
- Open the Cacti web interface and log in as an administrator.
- Navigation: Console → Management → Devices → Add.
- Fill in the following fields:
- Description: Didactum Rack Monitoring – Server Room A
- Hostname: 192.168.1.100
- Host Template: Generic SNMP-enabled Host (or a custom template, see section 6)
- SNMP Version: Version 2
- SNMP Community: public
- SNMP Port: 161
- SNMP Timeout: 500 ms
- Maximum OIDs per Get Request: 10
- Click Create.
5.2 Test the SNMP connection in the device
After creating the device, the SNMP status appears at the top of the page. If configured correctly, the system description of the Didactum device is displayed:
SNMP Information System: Didactum Rack Monitoring Unit II Location: Server Room A Contact: [admin@example.com](mailto:admin@example.com) Uptime: 15 days, 4:32:18
If no SNMP status appears: check the SNMP community string and IP address, and verify the firewall.
5.3 For SNMP v3 (increased security)
- Select SNMP Version: Version 3.
- Fill in the additional fields:
- SNMP Username: SNMP v3 user from the Didactum device
- SNMP Auth Protocol: SHA
- SNMP Auth Passphrase: authentication password
- SNMP Privacy Protocol: AES128
- SNMP Privacy Passphrase: encryption password
6. Configure Data Queries and SNMP Queries
In Cacti, there are two ways to query SNMP data from the Didactum device:
- SNMP Custom Collection (single OID): The simplest method for individual sensor values. Each OID is created as a separate data source.
- Data Query (SNMP table): Automatic detection of all sensors via an SNMP table OID. Useful when you have many similar sensors.
6.1 Create a data source for a single sensor (recommended starting point)
- Navigation: Console → Management → Data Sources → Add.
- Data Template: select SNMP – Generic OID Template (or create a new template, see 6.3).
- Device: select Didactum Rack Monitoring – Server Room A.
- In the Data Source Item section:
- OID: 1.3.6.1.4.1.3854.1.2.2.1.16.1.3.1 (Temperature Sensor 1)
- Data Source Type: GAUGE (for measured values such as temperature, humidity)
- Heartbeat: 600 (= 2× polling interval in seconds)
- Minimum: 0
- Maximum: U (unlimited)
- Save the data source.
6.2 RRDtool data source types for Didactum sensors
| Sensor Type | RRD Type | Reason |
|---|---|---|
| Temperature | GAUGE | Absolute value that can rise and fall |
| Humidity | GAUGE | Absolute value in % RH |
| Leakage status | GAUGE | Binary state value (0 or 1) |
| Voltage | GAUGE | Absolute value in volts |
| Door contact status | GAUGE | Binary state value (0 = closed, 1 = open) |
| Uptime | COUNTER | Monotonically increasing counter (hundredths of a second) |
6.3 Create a custom data template for temperature
- Navigation: Console → Templates → Data Templates → Add.
- Name: Didactum – Temperature Sensor
- In the Data Source Item section:
- Internal Data Source Name: temperature
- Minimum: -40
- Maximum: 100
- Data Source Type: GAUGE
- Heartbeat: 600
- In the Custom Data section:
- OID: 1.3.6.1.4.1.3854.1.2.2.1.16.1.3.|query_index| (for Data Queries with index)
- Save the template.
6.4 XML data query for automatic sensor detection
To automatically detect all temperature sensors, an XML data query file can be created. Store this file in the Cacti directory:
sudo nano /usr/share/cacti/resource/snmp_queries/didactum_temperature.xml
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<name>Didactum Temperature Sensors</name>
<description>Query all temperature sensors of the Didactum monitoring device</description>
<oid_uptime>1.3.6.1.2.1.1.3.0</oid_uptime>
<index_order>sensorIndex</index_order>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
<fields>
<sensorIndex>
<name>Sensor Index</name>
<direction>input</direction>
<source>index</source>
</sensorIndex>
<sensorName>
<name>Sensor Name</name>
<direction>input</direction>
<source>value</source>
<oid>1.3.6.1.4.1.3854.1.2.2.1.16.1.2</oid>
</sensorName>
<sensorValue>
<name>Temperature (raw value x10)</name>
<direction>input-output</direction>
<source>value</source>
<oid>1.3.6.1.4.1.3854.1.2.2.1.16.1.3</oid>
</sensorValue>
<sensorStatus>
<name>Sensor Status</name>
<direction>input</direction>
<source>value</source>
<oid>1.3.6.1.4.1.3854.1.2.2.1.16.1.4</oid>
</sensorStatus>
</fields>
</interface>Create analogous XML files for leakage (didactum_leak.xml) and humidity (didactum_humidity.xml) with the corresponding OID base paths (see the OID reference in section 8).
6.5 Import the data query into Cacti
- Navigation: Console → Management → SNMP Queries → Add.
- Name: Didactum – Temperature Sensors
- XML Path: <path_cacti>/resource/snmp_queries/didactum_temperature.xml
- Data Input Method: Get SNMP Data (Indexed)
- Save.
- Assign the data query to the Didactum device: Edit device → Associated Data Queries → Add Data Query → Didactum Temperature Sensors → Add.
- Click Run Queries to automatically detect all sensors.
7. Creating Graph Templates
7.1 Graph Template for Temperature
- Navigation: Console → Templates → Graph Templates → Add.
- Name: Didactum – Temperature
- In the Graph Template section:
- Title: |host_description| – Temperature |query_index|
- Vertical Label: Degrees Celsius
- Width: 700
- Height: 200
- Add Graph Template Items:
- Item 1: Type = DATA SOURCE, Data Source = Temperature Data Source, Color = FF0000, Graph Item Type = LINE2, Text Format = Temperature
- Item 2: Type = GPRINT, Data Source = as above, Consolidation = LAST, Text Format = Current\\:%8.1lf °C
- Item 3: Type = GPRINT, Consolidation = MAX, Text Format = Maximum\\:%8.1lf °C
- Item 4: Type = GPRINT, Consolidation = MIN, Text Format = Minimum\\:%8.1lf °C\\n
- Save the template.
Important:
Since Didactum returns temperature values × 10, either use the CDEF function in Cacti to divide the value or adjust the axis label accordingly:
- Navigation: Console → Data Management → CDEFs → Add.
- Name: Divide by 10 (Didactum)
- CDEF Items:
- Item 1: Type = Special Data Source, Value = CURRENT_DATA_SOURCE
- Item 2: Type = Another CDEF, Value = 10,/
- Assign the CDEF to the graph template item: Graph Template → Item → CDEF = Divide by 10.
7.2 Graph Template for Leakage (status display)
- New Graph Template: Didactum – Leakage Status
- Vertical Label: Leakage (0=OK, 1=Alarm)
- Graph Item: Type = AREA, Color = 0000FF (blue = normal), Graph Item Type = AREA
- Second item with threshold line: Type = HRULE, Value = 0.5, Color = FF0000, Text = Alarm threshold
7.3 Graph Template for Humidity
- New Graph Template: Didactum – Humidity
- Vertical Label: % relative humidity
- Graph Items: LINE2 in blue, GPRINT for Current/Max/Min
- Recommendation: draw HRULE lines at 20% (lower limit) and 80% (upper limit) in orange
7.4 Assign graphs to the device
- Navigation: Console → Management → Devices → Didactum device → Create Graphs for this Host.
- Select the desired graph templates (temperature, leakage, humidity, etc.).
- Click Create. Cacti automatically creates data sources and graphs.
- The graphs appear after the next polling cycle (max. 5 minutes) with the first data points.
7.5 Combine graphs in a dashboard
- Navigation: Console → Management → Graph Trees → Add.
- Name: Didactum Monitoring – Server Rooms
- Add tree items: Add Tree Item → Device → Didactum Rack Monitoring.
- All associated graphs are automatically grouped in the tree view.
8. OID reference for Cacti
8.1 Temperature Sensors
| OID | Description | Unit | RRD Type | Cacti Note |
|---|---|---|---|---|
| 1.3.6.1.4.1.3854.1.2.2.1.16.1.3.{n} | Temperature value sensor n | °C × 10 | GAUGE | CDEF ÷ 10 for correct display |
| 1.3.6.1.4.1.3854.1.2.2.1.16.1.4.{n} | Temperature status sensor n | Enum 0/1/2 | GAUGE | Use for Threshold plugin |
| 1.3.6.1.4.1.3854.1.2.2.1.16.1.7.{n} | Upper threshold sensor n | °C × 10 | GAUGE | Draw as HRULE in graphs |
| 1.3.6.1.4.1.3854.1.2.2.1.16.1.8.{n} | Lower threshold sensor n | °C × 10 | GAUGE | Draw as HRULE in graphs |
| 1.3.6.1.4.1.3854.1.2.2.1.16.1.2.{n} | Sensor name n | Text | – | For data query index labeling |
8.2 Leak Sensors
| OID | Description | Unit | RRD Type | Cacti Note |
|---|---|---|---|---|
| 1.3.6.1.4.1.3854.1.2.2.1.18.1.4.{n} | Leak status sensor n | 0=OK, 1=Leak | GAUGE | AREA graph; threshold at 0.5 |
| 1.3.6.1.4.1.3854.1.2.2.1.18.1.3.{n} | Leak value sensor n | 0=dry | GAUGE | Alternative to the status OID |
| 1.3.6.1.4.1.3854.1.2.2.1.18.1.2.{n} | Sensor name n | Text | – | For labeling |
8.3 Humidity Sensors
| OID | Description | Unit | RRD Type | Cacti Note |
|---|---|---|---|---|
| 1.3.6.1.4.1.3854.1.2.2.1.17.1.3.{n} | Humidity value sensor n | % RH | GAUGE | No factor needed |
| 1.3.6.1.4.1.3854.1.2.2.1.17.1.4.{n} | Humidity status n | Enum 0/1/2 | GAUGE | For Threshold plugin |
| 1.3.6.1.4.1.3854.1.2.2.1.17.1.7.{n} | Upper threshold sensor n | % RH | GAUGE | Draw as HRULE in graph |
| 1.3.6.1.4.1.3854.1.2.2.1.17.1.8.{n} | Lower threshold sensor n | % RH | GAUGE | Draw as HRULE in graph |
8.4 Additional Sensors
| OID | Description | Unit | RRD Type | Cacti Note |
|---|---|---|---|---|
| 1.3.6.1.4.1.3854.1.2.2.1.15.1.3.{n} | Voltage value sensor n | V × 10 | GAUGE | CDEF ÷ 10 for correct V display |
| 1.3.6.1.4.1.3854.1.2.2.1.15.1.4.{n} | Voltage status sensor n | Enum 0/1/2 | GAUGE | For Threshold plugin |
| 1.3.6.1.4.1.3854.1.2.2.1.10.1.3.{n} | Door contact status n | 0=closed, 1=open | GAUGE | AREA graph, binary |
| 1.3.6.1.4.1.3854.1.2.2.1.11.1.3.{n} | Vibration / motion n | 0=none, 1=alarm | GAUGE | AREA graph, binary |
| 1.3.6.1.4.1.3854.1.2.2.1.14.1.3.{n} | Smoke detector status n | 0=OK, 1=Alarm | GAUGE | AREA graph, threshold immediately |
| 1.3.6.1.2.1.1.3.0 | System Uptime (sysUpTime) | Hundredths of seconds | COUNTER | Standard SNMP OID |
9. Threshold Plugin for Alerting
Cacti itself does not provide a native alarm function.
The Thold plugin (Threshold) adds threshold monitoring and email notifications to Cacti.
9.1 Install the Thold plugin
# Download plugin (GitHub): cd /usr/share/cacti/plugins/ sudo git clone [https://github.com/Cacti/plugin_thold.git](https://github.com/Cacti/plugin_thold.git) thold sudo git clone [https://github.com/Cacti/plugin_settings.git](https://github.com/Cacti/plugin_settings.git) settings # Set permissions: sudo chown -R www-data:www-data /usr/share/cacti/plugins/thold sudo chown -R www-data:www-data /usr/share/cacti/plugins/settings
Enable plugins in Cacti: Console → Configuration → Plugin Management → thold → Enable, settings → Enable.
9.2 Configure email notifications
- Navigation: Console → Configuration → Settings → Mail/DNS.
- Fill in the following fields:
- Mail Services: SMTP
- Mail Server: IP or hostname of the SMTP server
- Mail Server Port: 25 or 587 (TLS)
- Mail From: [cacti@example.com](mailto:cacti@example.com)
- Mail From Name: Cacti Monitoring
- Send a test email: Send a Test Email.
9.3 Create a threshold for the temperature sensor
- Navigation: Console → Management → Thresholds → Add.
- Data Source: select Didactum Temperature Sensor 1.
- Settings:
- Threshold Type: High / Low
- High Warning: 300 (= 30 °C × 10)
- High Alert: 350 (= 35 °C × 10)
- Low Warning: 50 (= 5 °C × 10)
- Low Alert: 0
- Repeat Alert: 10 minutes
- Notify: enter email address(es)
- Save and activate the threshold.
9.4 Threshold for leak sensor (immediate alarm)
- Create a new threshold, Data Source: Didactum Leak Sensor 1.
- Settings:
- Threshold Type: High / Low
- High Alert: 0.5 (alarm for any value above 0)
- High Warning: leave blank (directly Critical)
- Repeat Alert: 5 minutes
- Notify: all relevant contacts
9.5 Recommended threshold settings
| Sensor Type | High Warning (raw value) | High Alert (raw value) | Low Warning | Repeat Interval |
|---|---|---|---|---|
| IT rack temperature (× 10) | 300 (30 °C) | 350 (35 °C) | 50 (5 °C) | 10 min |
| UPS room temperature (× 10) | 250 (25 °C) | 300 (30 °C) | 100 (10 °C) | 10 min |
| Humidity | 70 | 80 | 20 | 15 min |
| Leak | – | 0.5 | – | 5 min |
| Voltage 230 V AC (× 10) | 2530 (253 V) | 2600 (260 V) | 2070 (207 V) | 10 min |
| Door contact / smoke | – | 0.5 | – | 5 min |
10. Troubleshooting
| Problem | Possible cause / solution |
|---|---|
| Device shows “SNMP error" in the device status | Community string is incorrect or UDP port 161 is blocked. Test: run snmpwalk -v2c -c public 192.168.1.100 from the Cacti server. |
| Graphs remain empty / no data points | Poller is not running. Check cron job: crontab -l -u www-data. Test poller manually: sudo -u www-data php /usr/share/cacti/poller.php. |
| Temperature is displayed incorrectly by a factor of 10 (235 instead of 23.5) | Assign the CDEF “Divide by 10" to the graph template item (Console → Data Management → CDEFs). Alternatively, specify thresholds × 10. |
| OID returns “No Such Object" | Sensor is not connected or the index is incorrect. Run snmpwalk -v2c -c public 192.168.1.100 1.3.6.1.4.1.3854.1.2.2.1.16.1.3 to determine the available indices. |
| Data Query finds no sensors | Check the XML file for syntax errors. Run Queries again. Check the PHP error log: /var/log/apache2/error.log. |
| Thold plugin does not send emails | Check SMTP settings (Console → Settings → Mail). Send a test email. PHP mail function enabled? sendmail installed on the server? |
| RRD file is not created | Check write permissions: ls -la /var/lib/cacti/rra/. The directory must belong to the web server user (www-data). |
| Poller is running, but graphs show “NaN" | The OID value is outside the configured RRD min/max limits. Edit the data source: set Minimum to 0, Maximum to U (unlimited). |
Overview of Diagnostic Commands
# Test SNMP reachability: snmpwalk -v2c -c public 192.168.1.100 1.3.6.1.4.1.3854 # Query a single sensor: snmpget -v2c -c public 192.168.1.100 1.3.6.1.4.1.3854.1.2.2.1.16.1.3.1 # Run the poller manually (as the web server user): sudo -u www-data php /usr/share/cacti/poller.php --force # Run the poller with debug output: sudo -u www-data php /usr/share/cacti/poller.php --force --debug # Query the RRD file directly (show the last value): rrdtool lastupdate /var/lib/cacti/rra/didactum_temperature_1.rrd # Generate an RRD graph manually (test): rrdtool graph /tmp/test.png \\ --start -3600 \\ DEF:temp=/var/lib/cacti/rra/didactum_temperature_1.rrd:temperature:AVERAGE \\ LINE2:temp#FF0000:"Temperature" # Check the Cacti log: sudo tail -f /var/log/cacti/cacti.log # Check write permissions for the RRD directory: ls -la /var/lib/cacti/rra/ # Check PHP errors: sudo tail -f /var/log/apache2/error.log
Appendix: Cacti Configuration Quick Reference
| Task | Cacti navigation path |
|---|---|
| Create device | Console → Management → Devices → Add |
| Create data source | Console → Management → Data Sources → Add |
| Create graph template | Console → Templates → Graph Templates → Add |
| Create data template | Console → Templates → Data Templates → Add |
| Create SNMP data query | Console → Management → SNMP Queries → Add |
| Create graph for device | Console → Management → Devices → Device → Create Graphs |
| Create CDEF (calculation formula) | Console → Data Management → CDEFs → Add |
| Create threshold (Thold plugin) | Console → Management → Thresholds → Add |
| Email settings | Console → Configuration → Settings → Mail/DNS |
| Poller settings | Console → Configuration → Settings → Poller |
| Plugin management | Console → Configuration → Plugin Management |
| Graph Tree (dashboard) | Console → Management → Graph Trees → Add |
Always consult the current Didactum device documentation for firmware-specific OIDs and supported sensor types.