Re: No OID's for hrDeviceStatus in HOST-RESOURCES-MIB of net-SNMP agent(RHEL, Solaris)

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 12 April 2010 10:32, Evgeny Nagaev <[email protected]> wrote:
> OK, but can you provide me with info about how to extend your sources to
> support my own development of hrDeviceStatus support in net-snmp?

In the routine init_hr_disk(), look for the line

        device_descr[HRDEV_DISK] = describe_disk;

and add another

        device_status[HRDEV_DISK] = disk_status;


Then define the routine

    int disk_status( int idx ) {

         if ( /* disk 'idx' is running OK */ ) {
             return 2;  /* running */
         }
         if ( /* disk 'idx' is down */ ) {
             return 5;  /* down */
         }
    }

(for whichever status values you wish to return).
You can probably assume that all the information
set up in 'Save_HR_Disk_Specific' and 'Save_HR_Disk_General'
will be available and refer to the disk in question.


You can also do something similar for hrDeviceErrors
by registering

        device_errors[HRDEV_DISK] = disk_errors;

and defining 'disk_errors' appropriately.
(It follows the same framework, but returns the number
of errors for that particular disk)


See 'host/hr_network' for an example.

Dave

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.