vmware / vmware-aria-operations-integration-sdk

The VMware Aria Operations Integration SDK contains libraries, tools, and documentation for developing Management Packs for VMware Aria Operations. It is intended to make creating a Management Pack simple and fast, while allowing developers to use the language of their choice.
https://vmware.github.io/vmware-aria-operations-integration-sdk/
Apache License 2.0
13 stars 6 forks source link

Update snmp template #232

Closed kjrokos closed 12 months ago

kjrokos commented 12 months ago

Note: The README still needs some content updates. I will update this PR once it's ready.

Resolves #227, #209

Example 'Collect' output:

{
    "nonExistingObjects": [],
    "relationships": [
        {
            "children": [
                {
                    "adapterKind": "SNMP_Sample",
                    "identifiers": [],
                    "name": "IF-1",
                    "objectKind": "interface"
                },
                {
                    "adapterKind": "SNMP_Sample",
                    "identifiers": [],
                    "name": "IF-6",
                    "objectKind": "interface"
                }
            ],
            "parent": {
                "adapterKind": "SNMP_Sample",
                "identifiers": [],
                "name": "perses-drac",
                "objectKind": "device"
            }
        },
        {
            "children": [],
            "parent": {
                "adapterKind": "SNMP_Sample",
                "identifiers": [],
                "name": "IF-1",
                "objectKind": "interface"
            }
        },
        {
            "children": [],
            "parent": {
                "adapterKind": "SNMP_Sample",
                "identifiers": [],
                "name": "IF-6",
                "objectKind": "interface"
            }
        }
    ],
    "result": [
        {
            "events": [],
            "key": {
                "adapterKind": "SNMP_Sample",
                "identifiers": [],
                "name": "perses-drac",
                "objectKind": "device"
            },
            "metrics": [],
            "properties": [
                {
                    "key": "description",
                    "stringValue": "",
                    "timestamp": 1688764914937
                },
                {
                    "key": "oid",
                    "stringValue": "1.3.6.1.4.1.674.10892.5",
                    "timestamp": 1688764914937
                },
                {
                    "key": "uptime",
                    "numberValue": 16.0,
                    "timestamp": 1688764914937
                },
                {
                    "key": "contact",
                    "stringValue": "\"support@dell.com\"",
                    "timestamp": 1688764914937
                },
                {
                    "key": "location",
                    "stringValue": "\"unknown\"",
                    "timestamp": 1688764914937
                }
            ]
        },
        {
            "events": [],
            "key": {
                "adapterKind": "SNMP_Sample",
                "identifiers": [],
                "name": "IF-1",
                "objectKind": "interface"
            },
            "metrics": [
                {
                    "key": "speed",
                    "numberValue": 10000000.0,
                    "timestamp": 1688764915159
                },
                {
                    "key": "data:in|total",
                    "numberValue": 97743473.0,
                    "timestamp": 1688764915159
                },
                {
                    "key": "data:out|total",
                    "numberValue": 97743473.0,
                    "timestamp": 1688764915159
                },
                {
                    "key": "data:in|unicast",
                    "numberValue": 1031350.0,
                    "timestamp": 1688764915159
                },
                {
                    "key": "data:out|unicast",
                    "numberValue": 1031350.0,
                    "timestamp": 1688764915159
                },
                {
                    "key": "data:in|discards",
                    "numberValue": 0.0,
                    "timestamp": 1688764915159
                },
                {
                    "key": "data:out|discards",
                    "numberValue": 0.0,
                    "timestamp": 1688764915159
                },
                {
                    "key": "data:in|errors",
                    "numberValue": 0.0,
                    "timestamp": 1688764915159
                },
                {
                    "key": "data:out|errors",
                    "numberValue": 0.0,
                    "timestamp": 1688764915159
                }
            ],
            "properties": [
                {
                    "key": "description",
                    "stringValue": "lo",
                    "timestamp": 1688764915159
                },
                {
                    "key": "type",
                    "stringValue": "softwareLoopback",
                    "timestamp": 1688764915159
                },
                {
                    "key": "mtu",
                    "numberValue": 16436.0,
                    "timestamp": 1688764915159
                },
                {
                    "key": "address",
                    "stringValue": "",
                    "timestamp": 1688764915159
                },
                {
                    "key": "admin_status",
                    "stringValue": "Up",
                    "timestamp": 1688764915159
                },
                {
                    "key": "operational_status",
                    "stringValue": "Up",
                    "timestamp": 1688764915159
                }
            ]
        },
        {
            "events": [],
            "key": {
                "adapterKind": "SNMP_Sample",
                "identifiers": [],
                "name": "IF-6",
                "objectKind": "interface"
            },
            "metrics": [
                {
                    "key": "speed",
                    "numberValue": 100000000.0,
                    "timestamp": 1688764915286
                },
                {
                    "key": "data:in|total",
                    "numberValue": 74506853.0,
                    "timestamp": 1688764915286
                },
                {
                    "key": "data:out|total",
                    "numberValue": 20127594.0,
                    "timestamp": 1688764915286
                },
                {
                    "key": "data:in|unicast",
                    "numberValue": 736635.0,
                    "timestamp": 1688764915286
                },
                {
                    "key": "data:out|unicast",
                    "numberValue": 29270.0,
                    "timestamp": 1688764915286
                },
                {
                    "key": "data:in|discards",
                    "numberValue": 2.0,
                    "timestamp": 1688764915286
                },
                {
                    "key": "data:out|discards",
                    "numberValue": 0.0,
                    "timestamp": 1688764915286
                },
                {
                    "key": "data:in|errors",
                    "numberValue": 0.0,
                    "timestamp": 1688764915286
                },
                {
                    "key": "data:out|errors",
                    "numberValue": 0.0,
                    "timestamp": 1688764915286
                }
            ],
            "properties": [
                {
                    "key": "description",
                    "stringValue": "bond0",
                    "timestamp": 1688764915286
                },
                {
                    "key": "type",
                    "stringValue": "ethernetCsmacd",
                    "timestamp": 1688764915286
                },
                {
                    "key": "mtu",
                    "numberValue": 1500.0,
                    "timestamp": 1688764915286
                },
                {
                    "key": "address",
                    "stringValue": "e0:db:55:14:32:b8",
                    "timestamp": 1688764915286
                },
                {
                    "key": "admin_status",
                    "stringValue": "Up",
                    "timestamp": 1688764915286
                },
                {
                    "key": "operational_status",
                    "stringValue": "Up",
                    "timestamp": 1688764915286
                }
            ]
        }
    ]
}
Collection summary:

Table cell format is: 'total (min/median/max)'

Object Type            | Count | Metrics         | Properties      | Events | Parents        | Children
-----------------------+-------+-----------------+-----------------+--------+----------------+---------
SNMP_Sample::device    | 1     | 0               | 5               | 0      | 0              | 2
SNMP_Sample::interface | 2     | 18 (9 /9.0 /9 ) | 12 (6 /6.0 /6 ) | 0      | 2 (1 /1.0 /1 ) | 0

Parent Type         | Child Type             | Count
--------------------+------------------------+------
SNMP_Sample::device | SNMP_Sample::interface | 2

Avg CPU %                    | Avg Memory Usage %         | Memory Limit | Network I/O          | Block I/O
-----------------------------+----------------------------+--------------+----------------------+--------------
23.7 % (0.0% / 4.9% / 66.2%) | 5.1 % (4.0% / 4.0% / 7.1%) | 1.0 GiB      | 4.49 KiB / 17.53 KiB | 0.0 B / 0.0 B

Collection completed in 1.37 seconds.

All validation logs written to '/Users/kylerokos/Code/vrealize-operations-integration-sdk/samples/snmp-template-mp/logs/validation.log'
Validation passed with no errors