monkeyhanger63

updated

15 years ago

1

2272

October 6th, 2011 07:00

Setting the CurrentUtilization value of a Processor

I have a custom device that I have created the containment drivers for.

The device is now discovered with all of the component objects and their relationship(s) set correctly.

I now need to populate the values of the object attributes, among them the CurrentUtilization value of the Processor.

I can retrieve the value using SNMP but am unable to insert the value using dmctl using put or insert (see below)

dmctl> insert Processor::PSR-10.2.0.178/1::CurrentUtilization 77

CurrentUtilization: Can't perform set operation on scalar attribute

dmctl> put  Processor::PSR-10.2.0.178/1::CurrentUtilization 77

CI-E-EGENERIC-At

    /work/bluecurrent/FOUNDATION-7.0.2.X-HF/106/smarts/repos/mr/prop.c:277

    put: Attempted to call access method which is not available for given

    attribute

MR-UNAVAILABLE_ACCESS_METHOD-Attempted to call access method which is not

    available for given attribute

Could somebody please assist with a means of populating this attribute?

Thanks,

Duncan

  • Hemulll

    2 Intern

    •

    138 Posts

    926

    0

    Posted October 11th, 2011 04:00

    Hi Duncan.

    Please compile this code

    interface CPU_Performance_Alaxala6300 : Processor_Performance

    {

            instrument SNMP {

                      cpuUtil = "1.3.6.1.4.1.21839.2.2.8.2.2.1.1.16.1"

            };

            readonly instrumented attribute int cpuUtil

            "Percentage of CPU Utilisation";

            refine computed CurrentUtilization

            = cpuUtil;

    }

    and insert next section to OID2Type.conf file (note: ENVIRONMENTS not included to this section)

    .1.3.6.1.4.1.21839.1.2.8 {

        TYPE = Switch

        VENDOR = Alaxala

        CERTIFICATION = TEMPLATE

        CONT = Alaxala-6300

        VLAN = Dot1q

    INSTRUMENTATION:

        Interface-Fault             = MIB2

        Interface-Performance       = MIB2

        Port-Fault                  = MIB2

        Port-Performance            = MIB2

        Port-Ethernet-Performance   = dot3_Ethernet

        CPU/Memory                  = Alaxala6300:DeviceID

    }

    Code not tested but it should work :-)

    Also is important how u create Processor object in Containment drivers, please note that u fill DeviceID attribute.

    Message was edited by: Hemulll

  • Hemulll

    2 Intern

    •

    138 Posts

    926

    0

    Posted October 8th, 2011 03:00

    Hi.

    U get current error because this computed attribute CurentUtilization is propagated from Instrumentation CPU_Performance_ .

    If u created Instrumentation class for CPU monitoring, so should refine CurentUtilization field in Instrumentation class

    For example:

    interface CPU_Performance_xAcmePacket : Processor_Performance

    {

              instrument SNMP {

                        CpuUtil = ".1.3.6.1.4.1.9148.3.2.1.1.1"

              };

     

              readonly instrumented attribute int CpuUtil

              "Percentage of CPU utilization";

     

              refine computed CurrentUtilization

              = CpuUtil;

    }

  • Christian4

    30 Posts

    926

    1

    Posted October 10th, 2011 21:00

    Hello

    I would suggest to create a separate class and attribute with dynamic modeling.

    interface Processor_Fault_ _ :Processor_Fault

    {

      stored attribute float _Value ''some help text goes here" = 0;

      refine computed CurrentValue '''some help tet goes here' = _Value;

    }

    Compile it with dynmodel and reload APM.

    Like that you can set the value of the Processor.

    dmctl -s > put Processor_Fault_ _ :: :: _Value 10

    I haven't tried it but I would do it like that.

    Regards,

    Christian

  • 926

    0

    Posted October 11th, 2011 02:00

    Hi All,

    It seems that you are both telling me the same thing and I understand what you are explaining but I think that it has just opened up another question.

    I have set up this new class, Dunc_Performance based on the Processor_Performance class and compiled it without any errors. When I start the APM domain I see the interface being created correctly.

    What do I need to do to the oid2type_Field file to make it reference this new class?

    I have made the following change and restarted the domain but I still don't see any references to my new class.

    INSTRUMENTATION:

    Environment                 = Dunc:DeviceID

    Sorry if these are basic questions but the documentation is far from comprehensive.

    Thanks in advance,

    Duncan

  • Hemulll

    2 Intern

    •

    138 Posts

    926

    0

    Posted October 11th, 2011 03:00

    Hi Duncan, can u provide the code of model where u create CPU_Performance_Alaxala6300 class?

  • 926

    0

    Posted October 11th, 2011 03:00

    Hi,

    Thanks for that help,

    Here is the oid2type_Field section:

    .1.3.6.1.4.1.21839.1.2.8 {

        TYPE = Switch

        VENDOR = Alaxala

        CERTIFICATION = TEMPLATE

        CONT = Alaxala-6300

        VLAN = Dot1q

    INSTRUMENTATION:

        Environment                 = Alaxala6300:DeviceID

        Interface-Fault             = MIB2

        Interface-Performance       = MIB2

        Port-Fault                  = MIB2

        Port-Performance            = MIB2

        Port-Ethernet-Performance   = dot3_Ethernet   

    }

    From your example above, I will change the class to CPU_Performance_Alaxala6300

    Thanks again,

    Best Regards,

    Duncan

  • Hemulll

    2 Intern

    •

    138 Posts

    926

    0

    Posted October 11th, 2011 03:00

    Hi!

    1) Monitoring of processor is not in Environment INSTRUMENTATION  section, use "CPU/Memory" section

    2) Rename your class, it should be like "CPU_Performance_Dunc" inherited from "Processor_Performance"

    Please post code of oid2Type section and model.

  • 926

    0

    Posted October 11th, 2011 04:00

    Hi,

    Here is the mdl file:

    [root@smartsdemo model]# more DD-Devices.mdl

    interface Alaxala6300_Performance:Processor_Performance

    {

            instrument SNMP {

            cpuUtil="1.3.6.1.4.1.21839.2.2.8.2.2.1.1.16.1"

            };

            readonly instrumented attribute int cpuUtil

            "Percentage of CPU Utilisation";

            refine computed CurrentUtilization

            = cpuUtil;

    }

    [root@smartsdemo model]# vi DD-Devices.mdl

    When starting up, this is seen in the log file:

    [11-Oct-2011 11:29:22 AM+825ms BST] t@-175203440 LDM file processing #1

    DYN-W-CLASS_DEFINITION_CREATED- Interface CPU_Performance_Alaxala6300 created

        from DD-Devices.mdl:2

    Querying the device using the oid above gives:

    [root@smartsdemo logs]# sm_snmp -d 10.2.0.178 walk .1.3.6.1.4.1.21839.2.2.8.2.2.1.1.16.1

    SNMP Walk MIB starting at .1.3.6.1.4.1.21839.2.2.8.2.2.1.1.16.1

    .1.3.6.1.4.1.21839.2.2.8.2.2.1.1.16.1.1 = 98

    .1.3.6.1.4.1.21839.2.2.8.2.2.1.1.16.1.2 = -1

    Thanks again,

    Duncan

  • 926

    0

    Posted October 11th, 2011 06:00

    Hi,

    Thanks a lot for that, it now works wonderfully.

    Best Regards,

    Duncan