Unsolved
This post is more than 5 years old
30 Posts
0
984
How to handle disapearing SNMP MIB with Dynamic Modeling
Hello everybody
We create a dynamic model to be able to monitor a part of a device.
As soon this part is gone the information is gone in the SNMP MIB as well.
Has anybody done such an instrumentation with dynamic modeling?
Here is the example:
computed attribute OperationStatus_e SC_OperState "The current state."
= case(SC_OperationStatusInt) {
key 1: connected;
key 2: disconnected;
default: unknown;
} else case(errnum(SC_OperationStatusInt)) {
key SNMP_EXP_NOSUCHINSTANCE:
default: disassociating;
};
Unfortunately I'm not able to compile this model.
Any help would be great.
Best Regards,
Christian
PaulORourke
170 Posts
0
February 4th, 2014 02:00
Hi Christian,
Looking into this now.
What error do you see when compiling?
Thanks,
Paul O'Rourke
Christian4
30 Posts
0
February 5th, 2014 00:00
Hi Paul
69 computed attribute OperationStatus_e SC_OperState "The current state."
70 = case(SC_OperationStatusInt) {
71 key 1: connected;
72 key 2: disconnected;
73 default: unknown;
74 } else case(errnum(SC_OperationStatusInt)) {
75 key SNMP_EXP_NOSUCHINSTANCE:
76 default: disassociating;
77 };
Somehow the problem is on line 76.
dynmodel: "sc_test_NOTRELEASED.mdl", line 76: Key value must be a constant expression
dynmodel: "sc_test_NOTRELEASED.mdl", line 76: key type differs from selection expression at:"sc_test_NOTRELEASED.mdl", line: 74
dynmodel: sc_test_NOTRELEASED.mdl: found 2 errors
Compilation aborted due to errors.
But I have an enum defined:
enum OperationStatus_e { associated=1, disassociating=2, downloading=3, unknown=4 };
PaulORourke
170 Posts
0
February 6th, 2014 05:00
Hi Christian,
What version of Smarts IP are running?
Thanks,
Paul O'Rourke
PaulORourke
170 Posts
0
February 6th, 2014 06:00
Hi Christian,
Looks like there is a bug in the compiler.
Can you please try to compile the dynamic model with integers rather than enum symbols:
Original code:
74 } else case(errnum(SC_OperationStatusInt)) {
75 key SNMP_EXP_NOSUCHINSTANCE:
76 default: disassociating;
77 };
Updated:
74 } else case(errnum(SC_OperationStatusInt)) {
75 key 1289965683: disassociating;
76 default: disassociating;
77 };
Also, the dynamic model compiler does not handle "fall through" cases, so I've added disassociating
Can you please let me know if the model compiles correctly with the above changes?
Thanks,
Kind Regards,
Paul O'Rourke