Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

1550

April 15th, 2009 03:00

Dynamic Model - Refine Card class

Hello Smarts Gurus!

I have refined EMC Smarts "Card" class as "Slot" class for our task.
Card class has 3 event "Down" , "OperationallyDown", "SwitchOver" and "Status" field with enumeration type.

How can i set data in Status table with save enumeration format?


// Status field description.

Status string UNKNOWN Reflects the current state of the package as reported by the instrumentation. - OK indicates that the package is operating normally. - CRITICAL indicates that the package is at critical status. - MARGINAL indicates that the package is at marginal status. - OTHER indicates that the status of the package is other than the above or unrecognized SNMP error.- NOTPRESENT indicates the package MIB value missing. - UNKNOWN indicates the default value before SNMP polling.


P.s
May be, someone has Instrumentation class and simple class source examples?
It very difficult to create your polling and classes with no examples.

Message was edited by:
Hemul

April 15th, 2009 07:00

Hi Hemul,

the issue here is that the Card::Status is instrumented so the data comes from the instrumentation class (and in this instrumentation class, the data comes from SNMP) and is RO.

So you have 2 choices:
(1) you create an instrumentation (SNMP) for your new class and then make this instrumentation bound to instances of class Slot,
(2) you don't want / can't use an instrumentation (data not coming from SNMP), in this case, I think you should try to refine the Status attribute so it becomes RW (not sure this is possible).
If (2) doesn't work, then create a new instrumentation class (which inherits from Card_Fault) for class Slot, and in this one, simply set the Status attribute. This should work.

HTH,

--Fred

== Monitor your Smarts environment using APG ReportPack for Smarts health ==
Frederic Meunier
Solutions Watch4Net Inc
APG & Smarts InCharge integration
http://www.watch4net.com

2 Intern

 • 

138 Posts

April 15th, 2009 10:00

Hi Fred!

Currently i have my Instrumentation class created xHuawei_Card_Fault - collect operStatus for Huawei Cards and works fine.

If i create new instrumentation class refined from Cisco_Card_Fault or each other one I will collect data for OID-s from CIsco_Card_Fautl instrumentation class - it's not good.

My problem is:
How to set propagation data from my Instrumentation class (Huawei Card operStatus) to Status field with enumeration type.......

P.s
For example: Card class has problem "Down" and event "OperationallyDown", i think that calculated by Down problem and Down problem is calculated by Status.

A problem is present because we have no source code of original Smarts model. If i could to decompile sm_dlink_health.so or sm_dlink_cont.so or other model with Instrumentation class examples, all would have been much easier :-)

Currently, if i create my event or refine exists it works fine, but in Containment view i can not see Status for each slot, because can't set Status in Slot class.

//Code example
interface Card_Fault_xHuawei : ICIM_Instrumentation
{

instrument SNMP {
xHuaweiCardOperStatus = ".1.3.6.1.4.1.2011.6.3.3.2.1.8.0"
};

readonly instrumented attribute int xHuaweiCardOperStatus;

}

interface Slot:Card
"Slot class used for Huawei DSLAM only, developed by Nvision Group"
{
readonly attribute string Version
"Board version information.";

readonly attribute int NumberOfSubSlots
"The number of the subslot can be attached in the board."
"The number is determined on the board's being been made.";

// propagate attribute slot_oper_state OperStatus

propagate attribute int prod xOperStatus
"Oper Status"
<= Card_Fault_xHuawei, InstrumentedBy, xHuaweiCardOperStatus;

enum OperationalState {
UNINSTALL = 1,
UP = 2,
FAULT = 3,
DOWN = 4,
UNKNOWN = 6,
OFFLINE = 7,
ABNORMAL = 8
};

computed attribute OperationalState OperStatus
"Operational status of Slot"
=OperationalState(xOperStatus) else UNKNOWN;

/*
refine computed attribute OperationalState Status
= OperationalState(xOperStatus) else UNKNOWN;
*/


refine event OperationallyDown
=xOperStatus !=2;

export OperationallyDown;


// refine problem Down


/*
event SlotDown
"Huawei Slot Down"
=xOperStatus !=2;

export SlotDown;

*/
}

Sorry for my English.

Message was edited by:
Hemul

30 Posts

April 16th, 2009 01:00

SORRY: posted double!

null

30 Posts

April 16th, 2009 01:00

Hello Hemul

Here is the an example what I did for monitoring compaq disks.

---------------------------------------------------------------------------------------------------

interface Disk_Fault_SC_Cpqida:ICIM_Disk_Fault
{

instrument SNMP {
cpqDaPhyDrvStatus = "1.3.6.1.4.1.232.3.2.5.1.1.6"
};

readonly instrumented attribute int cpqDaPhyDrvStatus "This shows the status of the physical drive: 1=OTHER, 2=OK, 3=FAILDED, 4=PREDICTIVALFAI
LURE";

propagate attribute string DeviceID = Disk, Instruments, DeviceID;
}

---------------------------------------------------------------------------------------------------


Then you need a daemon driver to listen to status chanes.

---------------------------------------------------------------------------------------------------

GA_DaemonDriver::SC_COMPAQ-Listener-Driver
{
ReadsRulesFrom = GA_RuleSet::SC_COMPAQ-Listener-RS
{
fileName = "sc_info/sc_compaq-listener.asl"
}
ReadsInputFrom = GA_SubscriberFE::SC_COMPAQ-Listener-Subscriber-FE
{
SubscribesTo = {
GA_PropertyChoiceSubscription::SC_COMPAQ-Listener-SUB
{
classPattern = "*_SC_Cpqida"
instancePattern = "*"
propertyPattern = "cpqDaPhyDrvStatus"
glob = TRUE
quiet = FALSE
}
}
}
}

---------------------------------------------------------------------------------------------------


And at the end you need an ASL script which maps the integer to a more meaningful string.

debug=FALSE;

delim = "";
me = this->ReadsRulesFrom->fileName;

START {
timestamp: integer fs
{ CONNECT | CHANGE } eol
}

CONNECT {
"CONNECT" fs .. fs
}

CHANGE {
ATTRIBUTE_CHANGE | INVALIDATE
} do {
obj = object(class, instance);
if (obj->isNull()) { return; }

//1=other/unknown, 2=ok/running, 3=failed/down, 4=predictivalfailure/warning
if (value == 1) { obj->Status = "unknwon"; }
else if (value == 2) { obj->Status = "running"; }
else if (value == 3) { obj->Status = "down"; }
else if (value == 4) { obj->Status = "warning"; }
else { obj->Status = "unknwon"; }

DEBUG("SC_Compaq: ".class."::".instance."::".attribute." = ".value." (state=".obj->Status.")");
}

ATTRIBUTE_CHANGE {
"ATTRIBUTE_CHANGE" fs
class: word fs
instance: word fs
attribute: word fs
value: integer fs
}

INVALIDATE {
{"PROPERTY_SUSPEND"|"PROPERTY_REJECT"|"PROPERTY_ACCEPT"} fs
class: word fs
instance: word fs
attribute: word fs
.. fs
} do {
value = -1;
}

DEFAULT {
msg: rep(.. fs) eol
}

DEBUG(msg){
}do{
if (debug){
print("DEBUG: ".me." ".time()." > ".msg);
msg = "";
}

}

---------------------------------------------------------------------------------------------------

That's all you need.

Regards,
Christian

April 16th, 2009 06:00

Hi Hemul,

you should try to make Card_Fault_xHuawei inherits from Card_Fault ... in this case you already have the Status defined and propagate to the Status in the Slot class. Then you should refine the Status from the new Card_Fault_xHuawei in order to make Status the result of the enumeration.

--Fred

== Monitor your Smarts environment using APG ReportPack for Smarts health ==
Frederic Meunier
Solutions Watch4Net Inc
APG & Smarts InCharge integration
http://www.watch4net.com

2 Intern

 • 

138 Posts

April 16th, 2009 06:00

Hi Zug.

I think, Fred's solution is good for you too.
Without any additional asl scripts and drivers.

2 Intern

 • 

138 Posts

April 16th, 2009 06:00

Hello Fred.

Thanks you, my problem is solved.
I has refined Status field in instrumentation class and propagation works fine, without my intervention.

A lot of thanks.
No Events found!

Top