Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from yahoo/updateTojnxOperatingCPU
Juniper EX4300 CPU Util Oid Update
- Loading branch information
Showing
3 changed files
with
176 additions
and
1 deletion.
There are no files selected for viewing
167 changes: 167 additions & 0 deletions
167
tests/plugins/enrichment/generic/snmp/juniper/data/ex4300_results.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
{ | ||
"enrichment": [ | ||
{ | ||
"data": [ | ||
{ | ||
"127.0.0.1": { | ||
"metrics_groups": [ | ||
{ | ||
"dimensions": { | ||
"sensor": "temp_sensor_name.$index" | ||
}, | ||
"group_name": "environment", | ||
"metrics": { | ||
"temperature_fahrenheit": { | ||
"metric_type": "gauge", | ||
"transform": "lambda x: round((x * 1.8) + 32, 2) if x != 0 else 0.0", | ||
"type": "float", | ||
"value": "temp_sensor_values.$index" | ||
} | ||
} | ||
}, | ||
{ | ||
"dimensions": { | ||
"cpu_name": "cpu_name.$index", | ||
"cpu_no": "cpu_no.$index", | ||
"cpu_type": "'data' if 'Routing Engine' in cpu_name.$index else 'ctrl'" | ||
}, | ||
"group_name": "cpu", | ||
"metrics": { | ||
"cpu_utilization": { | ||
"metric_type": "gauge", | ||
"value": "cpu_util.$index" | ||
} | ||
} | ||
}, | ||
{ | ||
"dimensions": { | ||
"memory_type": "cpu_name.$index" | ||
}, | ||
"group_name": "memory", | ||
"metrics": { | ||
"memory_total": { | ||
"metric_type": "gauge", | ||
"value": "memory_total.$index" | ||
}, | ||
"memory_used": { | ||
"indices_from": "memory_total", | ||
"metric_type": "gauge", | ||
"value": "float(memory_used.$index) / 100.0 * memory_total.$index" | ||
} | ||
} | ||
}, | ||
{ | ||
"dimensions": {}, | ||
"group_name": "environment", | ||
"metrics": { | ||
"fans_ok": { | ||
"metric_type": "gauge", | ||
"value": "len([(x,y) for (x,y) in oper_status.items() if x in fans and y not in ['6']])" | ||
}, | ||
"fans_total": 5 | ||
} | ||
} | ||
], | ||
"oids": { | ||
"cpu_name": { | ||
"method": "static", | ||
"values": { | ||
"7.1.0.0": "FPC: EX4600-40F @ 0/*/*", | ||
"8.1.1.0": "PIC: 24x10G-4x40G @ 0/0/*", | ||
"8.1.2.0": "PIC: EX4600-EM-8F @ 0/1/*", | ||
"8.1.3.0": "PIC: EX4600-EM-8F @ 0/2/*", | ||
"9.1.0.0": "Routing Engine 0" | ||
} | ||
}, | ||
"cpu_no": { | ||
"method": "static", | ||
"values": { | ||
"7.1.0.0": "Module 7.1.0.0", | ||
"8.1.1.0": "Module 8.1.1.0", | ||
"8.1.2.0": "Module 8.1.2.0", | ||
"8.1.3.0": "Module 8.1.3.0", | ||
"9.1.0.0": "Module 9.1.0.0" | ||
} | ||
}, | ||
"cpu_util": { | ||
"method": "bulk_walk", | ||
"oid": ".1.3.6.1.4.1.2636.3.1.13.1.8" | ||
}, | ||
"fans": { | ||
"method": "static", | ||
"values": { | ||
"4.1.1.0": "Fan Tray 0 @ 0/0/*", | ||
"4.1.2.0": "Fan Tray 1 @ 0/1/*", | ||
"4.1.3.0": "Fan Tray 2 @ 0/2/*", | ||
"4.1.4.0": "Fan Tray 3 @ 0/3/*", | ||
"4.1.5.0": "Fan Tray 4 @ 0/4/*" | ||
} | ||
}, | ||
"memory_total": { | ||
"method": "static", | ||
"values": { | ||
"7.1.0.0": 2013265920, | ||
"9.1.0.0": 2013265920 | ||
} | ||
}, | ||
"memory_used": { | ||
"method": "bulk_walk", | ||
"oid": ".1.3.6.1.4.1.2636.3.1.13.1.11" | ||
}, | ||
"oper_status": { | ||
"method": "bulk_walk", | ||
"oid": ".1.3.6.1.4.1.2636.3.1.13.1.6" | ||
}, | ||
"power_module_types": { | ||
"method": "static", | ||
"values": {} | ||
}, | ||
"power_modules": { | ||
"method": "static", | ||
"values": {} | ||
}, | ||
"power_units_total": { | ||
"method": "static", | ||
"values": {} | ||
}, | ||
"temp_sensor_name": { | ||
"method": "static", | ||
"values": { | ||
"7.1.0.0": "FPC: EX4600-40F @ 0/*/*", | ||
"8.1.2.0": "PIC: EX4600-EM-8F @ 0/1/*", | ||
"8.1.3.0": "PIC: EX4600-EM-8F @ 0/2/*", | ||
"9.1.0.0": "Routing Engine 0" | ||
} | ||
}, | ||
"temp_sensor_values": { | ||
"method": "bulk_walk", | ||
"oid": ".1.3.6.1.4.1.2636.3.1.13.1.7" | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"metadata": { | ||
"_enrichment_group_creation_timestamp": 1512629517.03121, | ||
"_enrichment_ttl": 300, | ||
"_execute_frequency": 60 | ||
}, | ||
"namespace": "metrics" | ||
} | ||
], | ||
"enrichment_group_set_creation_timestamp": 1512629517.03121, | ||
"resource": { | ||
"resource_class": "network", | ||
"resource_creation_timestamp": 1512629517.03121, | ||
"resource_endpoint": "127.0.0.1", | ||
"resource_id": "test_id", | ||
"resource_metadata": { | ||
"_resource_ttl": "604800", | ||
"model": "EX4300-48P" | ||
}, | ||
"resource_plugin": "dummy", | ||
"resource_site": "test_site", | ||
"resource_subclass": "test_subclass", | ||
"resource_type": "test_type" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters