SNMP Solaris 10

284 views
Skip to first unread message

Xavi Vilalta

unread,
Oct 9, 2008, 7:33:58 AM10/9/08
to solaris-es
Holam alguien tiene idea de cómo configurar snmp con el servicio sma
para Solaris 10?
en teoria todo es tan fácil como editar el /etc/sma/snmp/snmpd.conf y
reiniciar el servicio, pero estoy teniendo problemas de puertos (161)
y tampoco sé como editar las MIB para que controle variables como uso
de cpu, disco ,e tc....

alguien tiene idea?

gracias

Mariano

unread,
Oct 9, 2008, 5:38:29 PM10/9/08
to solar...@googlegroups.com
Hola xavi, no es dificil mañana te paso un ejemplo de como consultar
las mibs de cpu, memoria desde linea de comandos.

Enviado desde mi iPhone

El 09/10/2008, a las 13:33, Xavi Vilalta <xavi.v...@gmail.com>
escribió:

Mariano J. Obarrio Miles

unread,
Oct 10, 2008, 5:03:52 AM10/10/08
to solar...@googlegroups.com
Hola Xavi, esto puede que te sea util

--- MIBs de CPU Solaris

# /usr/sfw/bin/snmpwalk -Osun -c public -v 1 192.168.152.15 .1.3.6.1.4.1.2021.11
.1.3.6.1.4.1.2021.11.1.0 = INTEGER: 1
.1.3.6.1.4.1.2021.11.2.0 = STRING: systemStats
.1.3.6.1.4.1.2021.11.3.0 = INTEGER: 0
.1.3.6.1.4.1.2021.11.4.0 = INTEGER: 0
.1.3.6.1.4.1.2021.11.5.0 = INTEGER: 70
.1.3.6.1.4.1.2021.11.6.0 = INTEGER: 3
.1.3.6.1.4.1.2021.11.7.0 = INTEGER: 1640
.1.3.6.1.4.1.2021.11.8.0 = INTEGER: 3521
.1.3.6.1.4.1.2021.11.9.0 = INTEGER: 13
.1.3.6.1.4.1.2021.11.10.0 = INTEGER: 35
.1.3.6.1.4.1.2021.11.11.0 = INTEGER: 53
.1.3.6.1.4.1.2021.11.50.0 = Counter32: 38656237
.1.3.6.1.4.1.2021.11.52.0 = Counter32: 30902305
.1.3.6.1.4.1.2021.11.53.0 = Counter32: 447670200
.1.3.6.1.4.1.2021.11.54.0 = Counter32: 0
.1.3.6.1.4.1.2021.11.55.0 = Counter32: 30902305
.1.3.6.1.4.1.2021.11.57.0 = Counter32: 5276250
.1.3.6.1.4.1.2021.11.58.0 = Counter32: 699890
.1.3.6.1.4.1.2021.11.59.0 = Counter32: 699890
.1.3.6.1.4.1.2021.11.60.0 = Counter32: 699890

root@newalpha # snmpwalk -Osu -c public -v 1 192.168.152.15 .1.3.6.1.4.1.2021.11
enterprises.ucdavis.systemStats.ssIndex.0 = INTEGER: 1
enterprises.ucdavis.systemStats.ssErrorName.0 = STRING: systemStats
enterprises.ucdavis.systemStats.ssSwapIn.0 = INTEGER: 0
enterprises.ucdavis.systemStats.ssSwapOut.0 = INTEGER: 0
enterprises.ucdavis.systemStats.ssIOSent.0 = INTEGER: 89
enterprises.ucdavis.systemStats.ssIOReceive.0 = INTEGER: 3
enterprises.ucdavis.systemStats.ssSysInterrupts.0 = INTEGER: 1850
enterprises.ucdavis.systemStats.ssSysContext.0 = INTEGER: 4261
enterprises.ucdavis.systemStats.ssCpuUser.0 = INTEGER: 15
enterprises.ucdavis.systemStats.ssCpuSystem.0 = INTEGER: 43
enterprises.ucdavis.systemStats.ssCpuIdle.0 = INTEGER: 43
enterprises.ucdavis.systemStats.ssCpuRawUser.0 = Counter32: 38657810
enterprises.ucdavis.systemStats.ssCpuRawSystem.0 = Counter32: 30906797
enterprises.ucdavis.systemStats.ssCpuRawIdle.0 = Counter32: 447674119
enterprises.ucdavis.systemStats.ssCpuRawWait.0 = Counter32: 0
enterprises.ucdavis.systemStats.ssCpuRawKernel.0 = Counter32: 30906797
enterprises.ucdavis.systemStats.ssIORawSent.0 = Counter32: 5285345
enterprises.ucdavis.systemStats.ssIORawReceived.0 = Counter32: 700389
enterprises.ucdavis.systemStats.ssRawInterrupts.0 = Counter32: 700389
enterprises.ucdavis.systemStats.ssRawContexts.0 = Counter32: 700389

--- Valores Puntuales con snmpget

# /usr/sfw/bin/snmpget -Osu -c public -v 1 192.168.152.15 .1.3.6.1.4.1.2021.11.9.0
enterprises.ucdavis.systemStats.ssCpuUser.0 = INTEGER: 14

# /usr/sfw/bin/snmpget -Osu -c public -v 1 192.168.152.15 .1.3.6.1.4.1.2021.11.10.0
enterprises.ucdavis.systemStats.ssCpuSystem.0 = INTEGER: 44

# /usr/sfw/bin/snmpget -Osu -c public -v 1 192.168.152.15 .1.3.6.1.4.1.2021.11.11.0
enterprises.ucdavis.systemStats.ssCpuIdle.0 = INTEGER: 46

Para arrancar el servicio de SNMP en Solaris 10

# svcadm enable sma

# svcs -a|egrep -i sma
online         Oct_08   svc:/application/management/sma:default


Configuracion de SNMP

# cat /etc/snmp/conf/snmpd.conf

--- Modificar la community
    read-community  public
    #write-community private

Puert del SNMP en /etc/services
snmpd           161/udp        snmp             # SMA snmp daemon



Xavi Vilalta

unread,
Oct 13, 2008, 4:37:15 AM10/13/08
to solaris-es
Gracias Mariano, haré pruebas en mis máquinas, sigo sin tener clara la
configuración...

Para Solaris 10 el fichero snmpd.conf está en /etc/sma/snmp/
snmpd.conf, el proceso en teoría para activar correctamente el daemon
sería:

#svcadm disable svc:/application/management/snmpdx:default
para desactivar el demonio de snmp de Sun

Entonces activamos el servicio de snmp de net-snmp, que es el activo
para Solaris 10:

#svcadm enable svc:/application/management/sma:default

El fichero de configuración: (ejemplo)

============================================================================
/etc/sma/snmp/snmpd.conf

###########################################################################
#
# snmpd.conf
#
# - created by the snmpconf configuration program
#
###########################################################################
###########################################################################
# SECTION: Admins who want to disable the snmpd daemon from
# starting at boot time.
# Change DISABLE=NO to DISABLE=YES
# DO NOT DELETE
# DO NOT UNCOMMENT
#DISABLE=NO
#
# end ADMIN
###########################################################################
#
# SECTION: Access Control Setup
#
# This section defines who is allowed to talk to your running
# snmp agent.

# rocommunity: a SNMPv1/SNMPv2c read-only access community name
# arguments: community [default|hostname|network/bits] [oid]

rocommunity public

##########################################################################
# SEA subagents dynamically register with the master agent via port
161,
# supplying a read-write community string on the request (e.g.
'private'
# for DMI). If the community strings used are not defined in the
# snmpd.conf file, the registration request will not be forwarded to
# the SEA master agent.
#
# rwcommunity: a SNMPv1/SNMPv2c read-write access community name
# arguments: community [default|hostname|network/bits] [oid]
#
# The following entry provides minimum access for successful
# SEA subagent registration.
#
rwcommunity private localhost .1.3.6.1.4.1.42.2.15

#rwcommunity private


###########################################################################
# SECTION: System Information Setup
#
# This section defines some of the information reported in
# the "system" mib group in the mibII tree.

# syslocation: The [typically physical] location of the system.
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysLocation.0 variable will
make
# the agent return the "notWritable" error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: location_string

syslocation "System administrators office"

# syscontact: The contact information for the administrator
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysContact.0 variable will
make
# the agent return the "notWritable" error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: contact_string

syscontact "System administrator"
sysservices 72

#
# dlmods for the seaProxy
#

# dlmod seaProxy /usr/sfw/lib/sparcv9/libseaProxy.so
# dlmod seaExtensions /usr/sfw/lib/sparcv9/libseaExtensions.so
master agentx


=============================================================

Entiendo que esto sería el fichero editado por defecto....

A nivel de editar las MIB, como podría conseguirlo?

Mariano J. Obarrio Miles

unread,
Oct 13, 2008, 1:38:57 PM10/13/08
to solar...@googlegroups.com
Si es verdad, no recuerdo a partir de que release de solaris se dejo de utilizar el snmpdx y comenzo a utilizarse solo el sma... por este tema tuve una incidencia y me recomendaron justamente lo que vos decis, desactivar el snmpdx y solo utilizar el sma.

Por lo demas la configuracion es muy similar y las mibs funcionan como te pase en el mail anterior.

Xavi Vilalta

unread,
Oct 14, 2008, 3:59:39 AM10/14/08
to solaris-es
Bueno, a partir de Solaris 10 uodate 4 , net-snmp viene integrado con
el OS. En cuanto al tema de las mib, te comento, en concreto estoy
intentando configurar una que controle el número de usuarios
conectados al sistema. Tienes alguna idea?

On 13 oct, 19:38, "Mariano J. Obarrio Miles"
<mariano.obar...@gmail.com> wrote:
> Si es verdad, no recuerdo a partir de que release de solaris se dejo de
> utilizar el snmpdx y comenzo a utilizarse solo el sma... por este tema tuve
> una incidencia y me recomendaron justamente lo que vos decis, desactivar el
> snmpdx y solo utilizar el sma.
>
> Por lo demas la configuracion es muy similar y las mibs funcionan como te
> pase en el mail anterior.
>

Rafa Priego

unread,
Nov 26, 2008, 10:57:18 AM11/26/08
to solaris-es
Hola,

Tengo que configurar snmp en Solaris 10. El archivo de configuración
SMA es igual que el que ponía Xavi, salvo que cambié el nombre de la
comunidad de lectura (rocommunity comLectura), y que me falta la
línea: "master agentx" (no sé qué significa). También tengo en el
fichero /etc/services la línea correspondiente al snmp.

Parece que al habilitar el servicio sma (y deshabilitar el snmpdx) Al
comprobar el estado de la variable ifOperStatus obtengo que la
interfaz Ethernet esta caída. Esto no es así, ya que estoy conectado a
ella.

$> ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu
8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500
index 2
inet 192.168.144.39 netmask ffffffc0 broadcast 192.168.144.63
ether 0:14:4f:86:68:34

$> /usr/sfw/bin/snmpwalk -v1 -c SSC18 localhost ifOperStatus
IF-MIB::ifOperStatus.1 = INTEGER: up(1)
IF-MIB::ifOperStatus.2 = INTEGER: down(2)

¿Sabéis alguno si me falta algo por hacer? ¿O tengo algo mal
configurado?
> > > ===========================================================================­=
> > > A nivel de editar las MIB, como podría conseguirlo?- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

Rafa Priego

unread,
Nov 26, 2008, 11:22:20 AM11/26/08
to solaris-es
Perdón, puse el nombre antiguo, en el snmpd.conf tengo "rocommunity
SSC18".

Gracias.
> > - Mostrar texto de la cita -- Ocultar texto de la cita -
Reply all
Reply to author
Forward
0 new messages