Hello,

I was total newbie with snmp, but after reading a lot of
documentations, groups, forums, examples now i've a little experience
to start my project.

But i've some conceptual doubts that hope you'll help me.

I need to implement a snmp monitoring system for a specified software
running on a linux server, this means the executions of commands to
get the variables or resources to monitor, so i think the best way
(considering the time i have) is extending net-snmp using the command
extend (deprecated exec) in snmpd.conf.

First Question ¿is really the best way use extend in my case?

In my first implementation y get some results, like

snmpwalk -v 1 -c public localhost PRAMIREZ-MIB::networkLnk.1
PRAMIREZ-MIB::networkLnk1.1.0 = INTEGER: available(1)
PRAMIREZ-
MIB::networkLnk1.2.1.2.11.110.101.116.119.111.114. 107.45.68.80.67 =
Wrong Type (should be INTEGER): STRING: "/bin/sh"
PRAMIREZ-
MIB::networkLnk1.2.1.3.11.110.101.116.119.111.114. 107.45.68.80.67 =
Wrong Type (should be INTEGER): STRING: "/home/SAC_SXB/Users_SAC/
pramirez/libexec/network-LINK.sh LINK_1"
PRAMIREZ-
MIB::networkLnk1.2.1.4.11.110.101.116.119.111.114. 107.45.68.80.67 =
Wrong Type (should be INTEGER): ""
PRAMIREZ-
MIB::networkLnk1.2.1.5.11.110.101.116.119.111.114. 107.45.68.80.67 =
INTEGER: 5
PRAMIREZ-
MIB::networkLnk1.2.1.6.11.110.101.116.119.111.114. 107.45.68.80.67 =
INTEGER: available(1)
PRAMIREZ-
MIB::networkLnk1.2.1.7.11.110.101.116.119.111.114. 107.45.68.80.67 =
INTEGER: available(1)
PRAMIREZ-
MIB::networkLnk1.2.1.20.11.110.101.116.119.111.114 .107.45.68.80.67 =
INTEGER: 4
PRAMIREZ-
MIB::networkLnk1.2.1.21.11.110.101.116.119.111.114 .107.45.68.80.67 =
INTEGER: available(1)
PRAMIREZ-
MIB::networkLnk1.3.1.1.11.110.101.116.119.111.114. 107.45.68.80.67 =
Wrong Type (should be INTEGER): STRING: "0"
PRAMIREZ-
MIB::networkLnk1.3.1.2.11.110.101.116.119.111.114. 107.45.68.80.67 =
Wrong Type (should be INTEGER): STRING: "0"
PRAMIREZ-
MIB::networkLnk1.3.1.3.11.110.101.116.119.111.114. 107.45.68.80.67 =
INTEGER: available(1)
PRAMIREZ-
MIB::networkLnk1.3.1.4.11.110.101.116.119.111.114. 107.45.68.80.67 =
INTEGER: 0
PRAMIREZ-
MIB::networkLnk1.4.1.2.11.110.101.116.119.111.114. 107.45.68.80.67.1 =
Wrong Type (should be INTEGER): STRING: "0"

PRAMIREZ-MIB is an example MIB file that is loaded into net-SNMP and
my NMS.

the networkLnk entry in the MIB is:

networkLnk1 OBJECT-TYPE
SYNTAX INTEGER {
available(1)
notAvailable(2)
}
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Network Link 1 Status"
::= { networkLnk 1 }

the extend command in snmpd.conf is:

extend .1.3.6.1.4.1.4227.1.146.1.12.1 "network-DPC" /bin/sh /home/
SAC_SXB/Users_SAC/pramirez/libexec/network-LINK.sh LINK_1

¿this looks good?

well, i'm stucked in know how to use the SYNTAX in MIB, i need to get
a available or notAvailable from response of:

snmpget -v 1 -c public localhost PRAMIREZ-MIB::networkLnk.1.1.0

now i'm always getting :
PRAMIREZ-MIB::networkLnk1.1.0 = INTEGER: available(1)

i've tried usin different return values from the shell script network-
LINK.sh (exit 1, exit 0), or different standard outputs but i cannot
modify that value.


Hope i explain well, i'm not good in english.


Very Thanks