hello,
i got a task to write an snmp agent for our product which is a linux-embedded device.
so i now tried to get myself into snmp, but now i am a bit confused how i can represent all the data which is very dynamic in my case. maybe one of you can point me how to do it.
my problem is that the data i have to present may vary on runtime .
basically the data i have to represent looks something like this:
+hardwareDevice1
-ParameterOfHardwareDevice 1[string: IDOfDevice]
-ParameterOfHardwareDevice 2[int: 21]
+HardwareComponentOfHardwareDevice1 A
-ParameterOfComponentA 1[string: IDOfComponent]
-ParameterOfComponentA 2[int: 32]
-ParameterOfComponentA 3
+HardwareComponentOfHardwareDevice1 B
-ParameterOfComponentB 1[string: IDOfComponent]
-ParameterOfComponentB 2[int: 55]
-ParameterOfComponentB 3
+VirtualDeviceOfComponentB
-ParamOfVirtualDevice 1
-ParamOfVirtualDevice 2
+VirtualDeviceOfComponentB
-ParamOfVirtualDevice 1
-ParamOfVirtualDevice 2
+hardwareDevice2
(...)
this means that HardwareComponentOfHardwareDevice1 A is of the same type like
HardwareComponentOfHardwareDevice1 B and has the same type of parameters, but with different values.
When programming i do not know how many Components there will be. There could only be A & B,
but there could also be A, B, C, D & E.
Because the tree structure i need to represent is variable, i cannot just assign each parameter an own OID.
The question now is:
How can i now represent this data?
Can i somehow represent this data in a tree-like structure if i do not exactly know how many nodes this tree will have? as far as i understand SNMP, i cannot.
Is the only possiblility to represent this by creating different MIB-Tables so having it represented in something like database tables?
Like, this:
MibTable ParameterOfHardwareDevice
columns:
ParameterOfHardwareDevice 1[IDOfComponent]
ParameterOfHardwareDevice 2[int]
MibTable HardwareComponentOfHardwareDevice
columns:
ParameterOfHardwareDevice 1[IDOfComponent]
ParameterOfComponent 1[IDOfComponent]
ParameterOfComponent 2
ParameterOfComponent 3
and so forth?
would this database approach be the normal way how to do it, or did i miss something?
i hope i could make myself clear.
i got a task to write an snmp agent for our product which is a linux-embedded device.
so i now tried to get myself into snmp, but now i am a bit confused how i can represent all the data which is very dynamic in my case. maybe one of you can point me how to do it.
my problem is that the data i have to present may vary on runtime .
basically the data i have to represent looks something like this:
+hardwareDevice1
-ParameterOfHardwareDevice 1[string: IDOfDevice]
-ParameterOfHardwareDevice 2[int: 21]
+HardwareComponentOfHardwareDevice1 A
-ParameterOfComponentA 1[string: IDOfComponent]
-ParameterOfComponentA 2[int: 32]
-ParameterOfComponentA 3
+HardwareComponentOfHardwareDevice1 B
-ParameterOfComponentB 1[string: IDOfComponent]
-ParameterOfComponentB 2[int: 55]
-ParameterOfComponentB 3
+VirtualDeviceOfComponentB
-ParamOfVirtualDevice 1
-ParamOfVirtualDevice 2
+VirtualDeviceOfComponentB
-ParamOfVirtualDevice 1
-ParamOfVirtualDevice 2
+hardwareDevice2
(...)
this means that HardwareComponentOfHardwareDevice1 A is of the same type like
HardwareComponentOfHardwareDevice1 B and has the same type of parameters, but with different values.
When programming i do not know how many Components there will be. There could only be A & B,
but there could also be A, B, C, D & E.
Because the tree structure i need to represent is variable, i cannot just assign each parameter an own OID.
The question now is:
How can i now represent this data?
Can i somehow represent this data in a tree-like structure if i do not exactly know how many nodes this tree will have? as far as i understand SNMP, i cannot.
Is the only possiblility to represent this by creating different MIB-Tables so having it represented in something like database tables?
Like, this:
MibTable ParameterOfHardwareDevice
columns:
ParameterOfHardwareDevice 1[IDOfComponent]
ParameterOfHardwareDevice 2[int]
MibTable HardwareComponentOfHardwareDevice
columns:
ParameterOfHardwareDevice 1[IDOfComponent]
ParameterOfComponent 1[IDOfComponent]
ParameterOfComponent 2
ParameterOfComponent 3
and so forth?
would this database approach be the normal way how to do it, or did i miss something?
i hope i could make myself clear.