I think the syntax is wrong. If you want to write to an attribute the value of another attribute, you'd have to use the GetAttributeValue Event Procedure first (to actually read the value that you want to copy), in conjunction with WriteAttributeValue (to actually write the value).
You don't have to use the value of the other attribute. You can make up for yourself a coding for your attributes, so you'd know what the value means, or you can use the coding that the system uses by default.
Instead of doing a GetAttributeValue (which in your case means a snmp poll on the device) followed by an WriteAttributeValue, you can use directly WriteAttributeValue with the coding that I was mentioning earlier. For example, for AdminStatus, the default coding used by the system is:
---
0x00000001 up
0x00000002 down
0x00000003 testing
---
So, for modifying the value of IfAdminStatus to up, you'd have to do this:
---
0x00010e3f E50 P "\
WriteAttribute (\
{C CURRENT_MODEL},\
{H
0xffff0766},\
{I 1})"
---
For the timestamp that i was mentioning earlier you should do smothing similar with:
---
0x00010e3f E50 P "\
WriteAttribute (\
{C CURRENT_MODEL},\
{H $ATTRIBUTE_HANDLE_OF_TS},\
GetCurrentTime())"
---
What you should do, is to minimize the work that the system should perform, as if you have many interfaces.
Default coding for statuses comes from:
$SPECROOT/SG-Support/CsEvFormat/EventTables/ifAdminStatus_en_US
$SPECROOT/SG-Support/CsEvFormat/EventTables/ifOperStatus_en_US
------------------------------
Senior Consultant
SolvIT Networks
------------------------------
Original Message:
Sent: 04-22-2021 04:38 AM
From: Vasco Pereira
Subject: SPECTRUM - Need to create a locater filter or a GC by attribute "ifadminstatus" (10e3f)
Hi catalin,
I´m created the new attributes inMTE, on ModelType "Gen_If_Port" (thas the type of interfaces i want to have those attributes showing), and they appear on interface attribute list, but i´m confused on next steps... created already the bellow entries in /$SPECROOT/custom/Events/EventDisp file:
0x00010e3f E 50 P "WriteAttribute( { C CURRENT_MODEL }, { H 0x00010e3f }, { H 0xffff0766 } )" For ifAdminstatus
0x00010e40 E 50 P "WriteAttribute( { C CURRENT_MODEL }, { H 0x00010e40 }, { H 0xffff0767 } )" for ifoperstatus
But nothing happens, were i´m failing ? wrong file to create the entry? the procedure is not well formed?
Appreciated for some help
Thanks again for your time
Best Regards
Original Message:
Sent: 04-19-2021 04:49 AM
From: Catalin Farcasanu
Subject: SPECTRUM - Need to create a locater filter or a GC by attribute "ifadminstatus" (10e3f)
That is exactly what I mean. There are several steps:
1) Expand the ModelType with new attibutes: InternalIffOperStatus, LastInternalIffOperStatusTime, InternalIfAdminStatus, LastInternalIfAdminStatusTime. Make sure you have at least 2 attributes (InternalIffOperStatus, LastInternalIffOperStatusTime) marked with Memory, so you'd get fast response on the GC defined query. I think it would be a good idea to store the timestamp of the last recorded/processed change of each attribute.
2) Use Event Procedures to modify the default events for modifying the newly created attributes to corresponding values. You should use WriteAttribute and GetCurrentTime Event Procedures. Create new events for this process, avoid changing default events.
3) Verify the change of the attributes based on multiple tests.
4) Create your required GCs based on the new created attributes.
You can take as reference for your new attributes some of the existing ones. You'll find at least one Attribute that is of type TimeTicks or status. You can have the external ones as reference, only to map them to new ones. There's a Last_Successful_Poll attribute of type Time Ticks.
You'll have a way to display those values at interface level, in a new subview for the interface.
I did something similar for a customer of mine.
------------------------------
Senior Consultant
SolvIT Networks
Original Message:
Sent: 04-16-2021 09:51 AM
From: Vasco Pereira
Subject: SPECTRUM - Need to create a locater filter or a GC by attribute "ifadminstatus" (10e3f)
Hi Catalin,
You are right, but some times, the answer doesn´t depend only from us :-), anyway thanks for the advice.
Regarding what you said :
"...Maybe you should use that system to create/manage a separate attribute that would update value of an attribute to match the current OperStatus/AdminStatus of an interface..."
That was the path i was thinking to follow, but need some help from your expert in how to do achieve this in spectrum, can you guide me please?
From my understanding, the idea should be... each time we receive a trap related to interface status, update a new attribute of that interface with that value, this should be done to traps of adminstatus and operstatus probably and this way i have the info from interfaces status :-)
Appreciate your help and time :-)
Thanks
BR
Original Message:
Sent: 04-16-2021 09:23 AM
From: Catalin Farcasanu
Subject: SPECTRUM - Need to create a locater filter or a GC by attribute "ifadminstatus" (10e3f)
That is exactly what I had in mind: poor design for a solution. That's not the way to monitor IfAdminStatus and IfOperStatus.
What's the benefit of having every 5 minutes the value of ifAdminStatus and ifOperStatus? I'll tell you, there's none. If you want to see a change in this parameter, monitor it using PM and add it to the attributes that the Interfaces MF polls. I believe these are not polled there either by default. There ifAdminStatus is evaluated every 24 hours.
For interfaces monitoring SPECTRUM relies mainly on traps sent by the devices. Based on those traps, the status of the interfaces is changed and bad link alarms are created. Maybe you should use that system to create/manage a separate attribute that would update value of an attibute to match the current OperStatus/AdminStatus of an interface. Then run that GC based on this attribute.
Do you know why it takes 15 minutes to evaluate the GC? Cause all statuses have to be read from all interfaces. That's exactly what you shouldn't do.
You have to understand what the client wants, and not to be afraid to say No, if the customer asks some dumb things.
------------------------------
Senior Consultant
SolvIT Networks
Original Message:
Sent: 04-16-2021 07:14 AM
From: Vasco Pereira
Subject: SPECTRUM - Need to create a locater filter or a GC by attribute "ifadminstatus" (10e3f)
Hy Guys,
Let me explain why of this thread, i have a customer request that needs to have the data from Operstatus and Adminstatus each 5 minutes from 100 000 interfaces, so i´ve been trying to get this info through the API (created a GC with teh needed interfaces) and retrieve the atributes from GC, but those are external attributes, so i´m getting around 10 to 15 m to retrieve this data because he query each one at that moment.
Using SRM, but info is old, so is not a solution
Maybe creating a X_OperStatus with the value of last poll that should be in DB, like happens with X_IfAlias and couple moe X_Attributes ? Is this possible to do ?
Any ideas of how could retrieve this data more quick less then 5 minutes ?
Appreciate your help and thanks for your attention
BR
Original Message:
Sent: 04-15-2021 11:12 AM
From: Catalin Farcasanu
Subject: SPECTRUM - Need to create a locater filter or a GC by attribute "ifadminstatus" (10e3f)
I would advise you not to create a search based on an external attribute. As Silvio was showing, Memory Attributes should be used first, then Database Attributes.
------------------------------
Senior Consultant
SolvIT Networks
Original Message:
Sent: 04-15-2021 09:57 AM
From: Vasco Pereira
Subject: SPECTRUM - Need to create a locater filter or a GC by attribute "ifadminstatus" (10e3f)
Hi Silvio
Thanks again for your attention and advise 😉
I´ve been searching only at root of ports folder thinking that should get all attributes of all subfolders like the GEN_IF_PORT, but understood now that I need to go into all categories to search inside them .
Thanks again.
BR
Cmpts
___________________________________________________________________________________________
|
Vasco Lobão Pereira
Operations Support Systems
M: +351 914 762 211
|
AVISO: A informação contida neste e-mail e ficheiros anexos são confidenciais e deverão ser lidos exclusivamente pela pessoa ou entidade a quem se dirigem. Se recebeu esta comunicação por engano, por favor, informe de imediato o remetente e apague a mensagem e os ficheiros anexos sem os ler, copiar, gravar, distribuir ou divulgar ou fazer qualquer outro uso da informação. Lembre-se da sua Responsabilidade Social Ambiental antes de decidir imprimir este e-mail.
|
Original Message:
Sent: 4/15/2021 8:52:00 AM
From: Silvio Okamoto
Subject: RE: SPECTRUM - Need to create a locater filter or a GC by attribute "ifadminstatus" (10e3f)
Hi Vasco,
Note that ifAdminStatus is an external attribute. Use this search with caution to avoid performance issues.
You can find the ifAdminStatus (0x10e3f) attribute ID under the Port Gen_IF_Port model type:
------------------------------
Technical Support Engineer IV
Broadcom Inc
Original Message:
Sent: 04-14-2021 12:17 PM
From: Vasco Pereira
Subject: SPECTRUM - Need to create a locater filter or a GC by attribute "ifadminstatus" (10e3f)
Hi Guys,
Need some help in creating a Locater search in interfaces of some devices by attribute IfAdminStatus, but couldn´t find that attribute in the available list to build the filter, do you have any idea of how to achieve that?
Another way i was trying is to create a GC with all the interfaces of those devices but filtered by adminstatus, again didn´t find that attribute.
Any ideas?
thanks for your attention.
BR