Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit e4671f9

Browse files
committed
Add new Network Performance counters
1 parent 0f27b87 commit e4671f9

2 files changed

Lines changed: 65 additions & 0 deletions

File tree

installer/conf/omi_mapping.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,46 @@
3939
}
4040
]
4141
},
42+
{
43+
"CimClassName": "SCX_EthernetPortStatistics",
44+
"ObjectName": "Network",
45+
"InstanceProperty": "InstanceID",
46+
"Namespace": "root/scx",
47+
"CimProperties": [
48+
{
49+
"CimPropertyName": "BytesTransmitted",
50+
"CounterName": "Total Bytes Transmitted"
51+
},
52+
{
53+
"CimPropertyName": "BytesReceived",
54+
"CounterName": "Total Bytes Received"
55+
},
56+
{
57+
"CimPropertyName": "BytesTotal",
58+
"CounterName": "Total Bytes"
59+
},
60+
{
61+
"CimPropertyName": "PacketsTransmitted",
62+
"CounterName": "Total Packets Transmitted"
63+
},
64+
{
65+
"CimPropertyName": "PacketsReceived",
66+
"CounterName": "Total Packets Received"
67+
},
68+
{
69+
"CimPropertyName": "TotalRxErrors",
70+
"CounterName": "Total Rx Errors"
71+
},
72+
{
73+
"CimPropertyName": "TotalTxErrors",
74+
"CounterName": "Total Tx Errors"
75+
},
76+
{
77+
"CimPropertyName": "TotalCollisions",
78+
"CounterName": "Total Collisions"
79+
}
80+
]
81+
},
4282
{
4383
"CimClassName": "SCX_FileSystemStatisticalInformation",
4484
"ObjectName": "Logical Disk",

test/code/plugins/omi_lib_test.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ def test_transform_class_returns_valid_record_all_counters
114114
"System Size Stored In Paging Files",
115115
"System Free Space in Paging Files",
116116
"System Uptime",
117+
"Network Total Bytes Transmitted",
118+
"Network Total Bytes Received",
119+
"Network Total Bytes",
120+
"Network Total Packets Transmitted",
121+
"Network Total Packets Received",
122+
"Network Total Rx Errors",
123+
"Network Total Tx Errors",
124+
"Network Total Collisions",
117125
"Process Pct Privileged Time",
118126
"Process Pct User Time",
119127
"Process Used Memory kBytes",
@@ -189,6 +197,11 @@ def test_transform_class_returns_valid_record_all_counters
189197
expected_process_record = [{"Host":"testhost", "ObjectName":"Process","InstanceName":"omsagent","Collections":[{"CounterName":"Pct User Time","Value":"0"},{"CounterName":"Pct Privileged Time","Value":"0"},{"CounterName":"Virtual Shared Memory","Value":"5216"}]}]
190198
transform_validate_records_helper(expected_process_record, process_perf_record , all_performance_counters, "Process Input Class Failed!")
191199

200+
#Test SCX_EthernetPortStatistics
201+
network_perf_record = [{"ClassName"=>"SCX_EthernetPortStatistics", "Caption"=>"Ethernet port information", "Description"=>"Statistics on transfer performance for a port", "InstanceID"=>"eth0", "BytesTransmitted"=>"3401031988", "BytesReceived"=>"2524808807", "PacketsTransmitted"=>"14880048", "PacketsReceived"=>"41066922", "BytesTotal"=>"5925840795", "TotalRxErrors"=>"0", "TotalTxErrors"=>"0", "TotalCollisions"=>"0"}]
202+
expected_network_record = [{"Host":"testhost","ObjectName":"Network","InstanceName":"eth0","Collections":[{"CounterName":"Total Bytes Transmitted","Value":"3401031988"},{"CounterName":"Total Bytes Received","Value":"2524808807"},{"CounterName":"Total Bytes","Value":"5925840795"},{"CounterName":"Total Packets Transmitted","Value":"14880048"},{"CounterName":"Total Packets Received","Value":"41066922"},{"CounterName":"Total Rx Errors","Value":"0"},{"CounterName":"Total Tx Errors","Value":"0"},{"CounterName":"Total Collisions","Value":"0"}]}]
203+
transform_validate_records_helper(expected_network_record, network_perf_record , all_performance_counters, "Network Input Class Failed!")
204+
192205
#Test Apache_HTTPDServerStatistics
193206
apacheserver_perf_record = [{"ClassName"=>"Apache_HTTPDServerStatistics","InstanceID"=>"/etc/httpd/conf/httpd.conf","TotalPctCPU"=>"0","IdleWorkers"=>"0","BusyWorkers"=>"0","PctBusyWorkers"=>"0","ConfigurationFile"=>"/etc/httpd/conf/httpd.conf"}]
194207
expected_apacheserver_record = [{"Host":"testhost", "ObjectName":"Apache HTTP Server","InstanceName":"/etc/httpd/conf/httpd.conf","Collections":[{"CounterName":"Total Pct CPU","Value":"0"},{"CounterName":"Idle Workers","Value":"0"},{"CounterName":"Busy Workers","Value":"0"},{"CounterName":"Pct Busy Workers","Value":"0"}]}]
@@ -219,6 +232,7 @@ def test_transform_class_returns_valid_record_filter_counters
219232
"Container Processor Usage sec",
220233
"System Uptime",
221234
"Process Pct User Time",
235+
"Network Total Packets Received",
222236
"Apache HTTP Server Total Pct CPU",
223237
"Apache Virtual Host Requests per Second",
224238
"MySQL Database Tables",
@@ -261,6 +275,12 @@ def test_transform_class_returns_valid_record_filter_counters
261275
expected_process_record = [{"Host":"testhost", "ObjectName":"Process","InstanceName":"omsagent","Collections":[{"CounterName":"Pct User Time","Value":"0"}]}]
262276
transform_validate_records_helper(expected_process_record, process_perf_record , filtered_performance_counters, "Filtered Process Input Class Failed!")
263277

278+
#Test SCX_EthernetPortStatistics
279+
network_perf_record = [{"ClassName"=>"SCX_EthernetPortStatistics", "Caption"=>"Ethernet port information", "Description"=>"Statistics on transfer performance for a port", "InstanceID"=>"eth0", "BytesTransmitted"=>"3401031988", "BytesReceived"=>"2524808807", "PacketsTransmitted"=>"14880048", "PacketsReceived"=>"41066922", "BytesTotal"=>"5925840795", "TotalRxErrors"=>"0", "TotalTxErrors"=>"0", "TotalCollisions"=>"0"}]
280+
281+
expected_network_record = [{"Host":"testhost", "ObjectName":"Network","InstanceName":"eth0","Collections":[{"CounterName":"Total Packets Received","Value":"41066922"}]}]
282+
transform_validate_records_helper(expected_network_record, network_perf_record , filtered_performance_counters, "Filtered Process Input Class Failed!")
283+
264284
#Test Apache_HTTPDServerStatistics
265285
apacheserver_perf_record = [{"ClassName"=>"Apache_HTTPDServerStatistics","InstanceID"=>"/etc/httpd/conf/httpd.conf","TotalPctCPU"=>"0","IdleWorkers"=>"0","BusyWorkers"=>"0","PctBusyWorkers"=>"0","ConfigurationFile"=>"/etc/httpd/conf/httpd.conf"}]
266286
expected_apacheserver_record = [{"Host":"testhost", "ObjectName":"Apache HTTP Server","InstanceName":"/etc/httpd/conf/httpd.conf","Collections":[{"CounterName":"Total Pct CPU","Value":"0"}]}]
@@ -318,6 +338,11 @@ def test_transform_class_returns_valid_record_filter_out_all_counters
318338
expected_process_record = [{"Host":"testhost", "ObjectName":"Process","InstanceName":"omsagent","Collections":[]}]
319339
transform_validate_records_helper(expected_process_record, process_perf_record , [], "Process Input with no counters Failed!")
320340

341+
#Test SCX_EthernetPortStatistics
342+
network_perf_record = [{"ClassName"=>"SCX_EthernetPortStatistics", "Caption"=>"Ethernet port information", "Description"=>"Statistics on transfer performance for a port", "InstanceID"=>"eth0", "BytesTransmitted"=>"3401031988", "BytesReceived"=>"2524808807", "PacketsTransmitted"=>"14880048", "PacketsReceived"=>"41066922", "BytesTotal"=>"5925840795", "TotalRxErrors"=>"0", "TotalTxErrors"=>"0", "TotalCollisions"=>"0"}]
343+
expected_network_record = [{"Host":"testhost","ObjectName":"Network","InstanceName":"eth0","Collections":[]}]
344+
transform_validate_records_helper(expected_network_record, network_perf_record , [], "Network Input with no counters Failed!")
345+
321346
#Test Apache_HTTPDServerStatistics
322347
apacheserver_perf_record = [{"ClassName"=>"Apache_HTTPDServerStatistics","InstanceID"=>"/etc/httpd/conf/httpd.conf","TotalPctCPU"=>"0","IdleWorkers"=>"0","BusyWorkers"=>"0","PctBusyWorkers"=>"0","ConfigurationFile"=>"/etc/httpd/conf/httpd.conf"}]
323348
expected_apacheserver_record = [{"Host":"testhost", "ObjectName":"Apache HTTP Server","InstanceName":"/etc/httpd/conf/httpd.conf","Collections":[]}]

0 commit comments

Comments
 (0)