Power Consumption Monitoring in the Data Center with SNMP and Cross-Platform Delphi Apps

Power Consumption Monitoring in the Data Center with SNMP and Cross-Platform Delphi Apps
In our data center (CED), I developed a custom solution to monitor the power consumption of equipment, with the goal of improving energy efficiency, preventing overload, and optimizing resource usage.
Why a custom system?
My goal was twofold:
- To monitor energy consumption in detail for each device, identify waste, verify real-time load, and store historical data for analysis.
- To prevent overload situations by enabling the system to communicate with our ERP and automatically shut down non-critical machines if needed.
Monitored devices
The system periodically polls APC Metered PDUs and APC Schneider Electric Li-Ion UPS units, both SNMP v1/v2c compatible.
Collected data includes:
- Total and per-outlet power usage (PDU)
- Battery status and runtime (UPS)
- Current, voltage, and active power
Technology and tools used
I built Delphi 12.2 applications compatible with both Windows and Linux, capable of SNMP polling, data processing, and Excel file generation for Xtumble ERP integration.
SNMP access is handled using the TidSNMP component from the Indy library.
Example Delphi code using TidSNMP
var
SNMP: TidSNMP;
begin
SNMP := TidSNMP.Create(nil);
try
SNMP.Host := '192.168.1.100';
SNMP.Community := 'public';
SNMP.Query.Clear;
SNMP.Query.Add('1.3.6.1.4.1.318.1.1.12.1.16.0');
SNMP.SendQuery;
if SNMP.Reply.Count > 0 then
ShowMessage('Power: ' + SNMP.Reply.ValueFromIndex[0] + ' Watt');
finally
SNMP.Free;
end;
end;
SNMP analysis with snmpwalk
To identify the available OIDs, we used the snmpwalk
command on Linux:
snmpwalk -v2c -c public 192.168.1.100
This helped us understand which metrics were exposed by each device.
ERP integration
The collected data is saved in Excel files and sent to our Xtumble ERP system for:
- Storage and history tracking
- Reports and statistics generation with data aggregations
- Mail and Push Notifications for Alerts
- Automatic actions (e.g., shutdown of secondary machines)
Future expansions
Currently under development:
- Email/Telegram alerts
- Interactive web dashboard
- Integration with automation tools (e.g., Ansible)
If you’re interested in integrating SNMP with Delphi or monitoring APC devices, feel free to leave a comment!