Home
[RDK Central Wiki]
CMF
[Code Releases]
Hi All,
I am new to understand how CCSP work.
I am trying the SNMP-PA on my device and not sure how the mapping between DM and MIB is working.
1. Make sure what CCSP_MIB_MAPPING_LIST_FILE I am using.
I added some debug mess in CcspSnmpPlugin.c, so I am sure about I loaded the CcspRDKBMibList.xml:
<ccspRDKBMibList xml="http://www.w3.org/XML/1998/namespace">
<!-- other mib files -->
<mibFile>Ccsp_RDKB-RG-MIB-Lan-Dhcp.xml</mibFile>
<mibFile>Ccsp_RDKB-RG-WiFi-MIB.xml</mibFile>
<mibFile>Ccsp_RDKB-RG-MIB-routing.xml</mibFile>
<!--<mibFile>Ccsp_RDKB-RG-MIB-NTP.xml</mibFile>-->
<mibFile>Ccsp_RDKB-RG-MIB-Firewall.xml</mibFile>
<mibFile>Ccsp_RDKB-RG-MIB-DeviceMgmt.xml</mibFile>
<mibFile>Ccsp_RDKB-RG-MIB-WanDns.xml</mibFile>
<mibFile>Ccsp_RDKB-RG-MIB-Vlan.xml</mibFile>
<mibFile>Ccsp_RDKB-RG-MIB-MoCA.xml</mibFile>
<mibFile>Ccsp_RDKB-RG-MIB-Hotspot.xml</mibFile>
<mibFile>Ccsp_COMCAST-MIB-StaticIp.xml</mibFile>
<mibFile>Ccsp_RDKB-RG-MIB-Tr069Pa.xml</mibFile>
<mibFile>XOPS-DEVICE-MGMT-MIB.xml</mibFile>
<mibFile>DEVICE-WEBPA-MIB.xml</mibFile>
<mibFile>SELFHEAL-DEVICE-MIB.xml</mibFile>
<!--<mibFile>MDC-DEVICE-MIB.xml</mibFile>-->
</ccspRDKBMibList>
2. After the firmware ready on my device, I run "ps | grep snmp" to check the snmp_subagent:
root@Gateway:~# ps | grep snmp
2657 root 7392 S /usr/sbin/snmpd -LS0-6d -f
3351 root 2604 S {run_subagent.sh} /bin/sh - /usr/ccsp/snmp/run_subag
3433 root 37896 S /usr/bin/snmp_subagent -x tcp:127.0.0.1:705
11971 root 2120 S grep snmp
root@Gateway:~# cd /tmp
root@Gateway:/tmp# ls *snmp*
snmp_subagent_initialized
root@Gateway:/tmp#
3. Use snmpget and dmcli to check the mapping between MIB and DataModel:
ex: Ccsp_RDKB-RG-MIB-DeviceMgmt.xml
(rdkbRgDeviceMode 1.3.6.1.4.1.17270.50.2.1.1.1.0 <> Device.X_CISCO_COM_DeviceControl.DeviceMode)
root@Gateway:/tmp# dmcli eRT getvalues Device.X_CISCO_COM_DeviceControl.DeeviceModeis
dmcli_command: dmcli eRT getvalues Device.X_CISCO_COM_DeviceControl.DeviceMode
CR component name is: eRT.com.cisco.spvtg.ccsp.CR
subsystem_prefix eRT.
getvalues from/to component(eRT.com.cisco.spvtg.ccsp.pam): Device.X_CISCO_COM_DeviceControl.DeviceMode
Execution succeed.
Parameter 1 name: Device.X_CISCO_COM_DeviceControl.DeviceMode
type: string, value: Dualstack
root@Gateway:/tmp#
root@Gateway:/tmp#
root@Gateway:/tmp# snmpget -v2c -c public 127.0.0.1 1.3.6.1.4.1.17270.50.2.1.1.1.0
SNMPv2-SMI::enterprises.17270.50.2.1.1.1.0 = No Such Object available on this agent at this OID
[Question] About the step3, I can get the DeviceMode value from DM by "dmcli", but I didn't find the OID for rdkbRgDeviceMode by "snmpget".
I assume that MIB should be ready when snmp_subagent initialized and running with the mapping.
Did I miss something or get something wrong?
Thanks.
8 Comments
Narayanaswamy Ramaiyer
Hi Hsu Chih-Hao,
The steps seem to be correct.
Can you try the below step and show the output?
Hsu Chih-Hao
Hi,
Thanks for the reply.
I tried to run all MIBs via 'snmpwalk', and the result below are all I got.
I did snmp walk the family about '1.3.6.1.4.1.17270' but nothing return:
root@Gateway:~# snmpwalk -mALL -v2c -c public 127.0.0.1 1.3.6.1.4.1.17270 2>/dev/null
COMCAST-SMI::comcast = No more variables left in this MIB View (It is past the end of the MIB tree)
root@Gateway:~# snmpwalk -mALL -v2c -cpublic localhost 1.3.6 2>/dev/null
SNMPv2-MIB::sysDescr.0 = STRING: Linux #1 SMP Mon Mar 4 09:47:02 CST 2019 armv7l
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-TC::linux
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (219261) 0:36:32.61
SNMPv2-MIB::sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
SNMPv2-MIB::sysName.0 = STRING: Linux
SNMPv2-MIB::sysLocation.0 = STRING: Unknown (configure /etc/snmp/snmpd.local.conf)
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (74) 0:00:00.74
SNMPv2-MIB::sysORID.1 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.2 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORID.3 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.5 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.6 = OID: RFC1213-MIB::ip
SNMPv2-MIB::sysORID.7 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.8 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORID.9 = OID: SNMP-NOTIFICATION-MIB::snmpNotifyFullCompliance
SNMPv2-MIB::sysORID.10 = OID: NOTIFICATION-LOG-MIB::notificationLogMIB
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.2 = STRING: The management information definitions for the SNMP User-based Security Model.
SNMPv2-MIB::sysORDescr.3 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.6 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.7 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.8 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORDescr.9 = STRING: The MIB modules for managing SNMP Notification, plus filtering.
SNMPv2-MIB::sysORDescr.10 = STRING: The MIB module for logging SNMP Notifications.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (63) 0:00:00.63
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (63) 0:00:00.63
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (63) 0:00:00.63
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (64) 0:00:00.64
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (64) 0:00:00.64
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (65) 0:00:00.65
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (66) 0:00:00.66
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (66) 0:00:00.66
SNMPv2-MIB::sysORUpTime.9 = Timeticks: (72) 0:00:00.72
SNMPv2-MIB::sysORUpTime.10 = Timeticks: (74) 0:00:00.74
SNMPv2-MIB::sysORUpTime.10 = No more variables left in this MIB View (It is past the end of the MIB tree)
I also built a image for RDK emulator (with same rdkb code folder).
This time I can get MIB(rdkbRgDeviceMode) return:
root@qemux86broadband:/# snmpget -v2c -c public 127.0.0.1 1.3.6.1.4.1.17270.50.2.1.1.1.0
SNMPv2-SMI::enterprises.17270.50.2.1.1.1.0 = INTEGER: 0
Thanks.
Z-chandra sekhar N
Even I am facing similar issue .. where none of the RDKB related OID are not coming when I am doing snmpwalk on RPI device with lCMF code ( Aug 30 ,2018 )
I see the the scalar handler registered (highlighted below) is not getting triggered which results in not displaying related OIDs
reginfo_stats = netsnmp_create_handler_registration (pThisObject→MibName, handleScalarGroupRequest, oidReg, .....);
Is it some thing to be changed at snmpd.conf file ?
I am not sure .. what is missing here to be operational . your help would be greatly appreciated
Z-chandra sekhar N
Finally solved it with help of my Colleague Sanchar .
Here is the root cause
ccsp Snmp subagent run as a slave at 127.0.0.1:705 by default.
But snmpd is not running as master .so subagent will never be able to to connect to snmpd . so the related OIDs handled by subagent can not coming during snmpwalk.
Solution: run snmpd proc as master at 127.0.0.1:705( Add below lines to /etc/snpd/snmpd.conf file) . so subagent can connect to it and able perform snmp operations for CCSP OIDs .
master agentx
agentxsocket tcp:localhost:705
Please note that these lines should at beginning of the file .
Thanks
Sekhar
Hsu Chih-Hao
Hi All,
I got some difference between emulator and my target device.
The way is about the option for snmpd.
1. Emulator
root@qemux86broadband:/usr/ccsp/snmp# ps aux | grep snmp
root 863 0.0 0.9 8104 4712 ? Ss 04:30 0:01 /usr/sbin/snmpd -f -C -c /usr/ccsp/snmp/snmpd.conf -M /usr/share/snmp/mibs -Le
2. My target device
root@Linux:/usr/ccsp/snmp# ps | grep snmp
2659 root 7392 S /usr/sbin/snmpd -LS0-6d -f
Then I found the 'run_snmpd.sh' in CCSP-SNMP-PA folder (/usr/ccsp/snmp) about snmpd option.
I kill the original snmpd which is created by the target device after bootup then run 'run_snmpd.sh'.
Now I can get return from the MIB which mapping to the data model:
1. My target device with old snmpd option (/usr/sbin/snmpd -LS0-6d -f):
root@Linux:/usr/ccsp/snmp# snmpget -v2c -c public 127.0.0.1 1.3.6.1.4.1.17270.50.2.1.1.1.0
SNMPv2-SMI::enterprises.17270.50.2.1.1.1.0 = No Such Object available on this agent at this OID
2. My target device with new snmpd option after I ran "run_snmpd.sh" (snmpd -f -C -c snmpd.conf -M ./mibs -Le):
root@Linux:/usr/ccsp/snmp# snmpget -v2c -c public 127.0.0.1 1.3.6.1.4.1.17270.50.2.1.1.1.0
SNMPv2-SMI::enterprises.17270.50.2.1.1.1.0 = INTEGER: 5
Note: I modified 2 files.
A.
/usr/ccsp/snmp/run_snmpd.sh
Change './snmpd' to 'snmpd'
B.
/usr/ccsp/snmp/snmpd.conf
Change 'dlmod ccsp_snmp_plugin libsnmp_plugin'
to 'dlmod ccsp_snmp_plugin /usr/lib/libsnmp_plugin.so'
Hsu Chih-Hao
Hi Sekhar,
Thanks for your reply.
I will try your solution on my device.
Thanks.
Hsu Chih-Hao
Hi Sekhar,
I process the steps below which add your suggestion in /etc/snmpd/snmpd.conf, but I still cannot get the CCSP MIB on my device.
Could you tell anything I miss?
root@brcm93390wrg:/etc/snmp# ps | grep snmp
2673 root 7396 S /usr/sbin/snmpd -LS0-6d -f
3375 root 2604 S {run_subagent.sh} /bin/sh - /usr/ccsp/snmp/run_subag
3459 root 37896 S /usr/bin/snmp_subagent -x tcp:127.0.0.1:705
7421 root 2120 S grep snmp
root@brcm93390wrg:/etc/snmp# kill 2673
root@brcm93390wrg:/etc/snmp# vi snmpd.conf
master agentx
agentxsocket tcp:localhost:705
:wq
root@brcm93390wrg:/etc/snmp# /usr/sbin/snmpd -LS0-6d -f &
root@brcm93390wrg:/etc/snmp# ps | grep snmp
3459 root 37984 S /usr/bin/snmp_subagent -x tcp:127.0.0.1:705
7600 root 7748 S /usr/sbin/snmpd -LS0-6d -f
root@brcm93390wrg:/etc/snmp#
root@brcm93390wrg:/etc/snmp# snmpget -v2c -c public 127.0.0.1 1.3.6.1.4.1.17270.50.2.1.1.1.0
SNMPv2-SMI::enterprises.17270.50.2.1.1.1.0 = No Such Object available on this agent at this OID
Thanks.
Z-chandra sekhar N
Hi Hsu,
Sorry for the delayed reply..
Did you change the firewall rules before doing the snmp operations
On the terminal, enter below commands and do snmp operations
iptables -A wan2self_mgmt -i erouter0 -p tcp -m tcp --dport 161 -j ACCEPT
iptables -A wan2self_mgmt -i erouter0 -p udp -m udp --dport 161 -j ACCEPT