Never let your sense of morals prevent you from doing what is right.

25,072 点击次数

作者: Centro Sun

  • How to configure the SNMP protocol of AIX

    How to configure the SNMP protocol of AIX

    1, Configuring the SNMP Agent in the AIX

    1×1 Check the current running SNMP version

    ls -l /usr/sbin/snmpd*
    AIX SNMP

    You can see that the current snmpd is using snmpdv3ne, which means that it supports the non-encrypted version of SNMPv3, ne=no encryption, as long as /etc/snmpdv3.conf is configured, it can be used in the way of SNMPv1, so the default version can meet the requirements, if there are special needs, you can also change the version with snmpv3_ssw command.

    Switch to SNMPv1

    snmpv3_ssw -1

    Switching to SNMPv3 non-encrypted version

    snmpv3_ssw -n

    Switch to the encrypted version of SNMPv3 (this version is not installed by default)

    snmpv3_ssw -e

    1×2 Create a community called hmsnmp

    Modify the /etc/snmpdv3.conf file as shown below, taking special care to mark the sections with red lines.

    Where 192.0.243.113 is the IP address of the monitoring tool, indicating that only this IP is allowed to access SNMP of AIX, for security reasons.

    1×3 Stop and start the service to make changes to /etc/snmpdv3.conf effective

    stopsrc -s aixmibd
    stopsrc -s snmpmibd
    stopsrc -s hostmibd
    stopsrc -s snmpd
    startsrc -s snmpd
    startsrc -s hostmibd -a "-c hmsnmp"
    startsrc -s snmpmibd -a "-c hmsnmp"
    startsrc -s aixmibd -a "-c hmsnmp"

    It is important to note that when the operating system reboots, the default boot parameters are public community, so in order to make the hmsnmp community work properly after the reboot, it is recommended to modify the /etc/rc.tcpip file to modify the default boot parameters as follows.

    Start up the hostmibd daemon

    start /usr/sbin/hostmibd "$src_running" "-c hmsnmp "

    Start up the snmpmibd daemon

    start /usr/sbin/snmpmibd "$src_running" "-c hmsnmp "

    Start up the aixmibd daemon

    start /usr/sbin/aixmibd "$src_running" "-c hmsnmp "

    1×4 testing for normal SNMP service

    Execute the following commands locally:

    # snmpinfo -md -c hmsnmp sysDescr
    
    1.3.6.1.2.1.1.1.0 = "IBM PowerPC CHRP Computer
    Machine Type: 0x0800004c Processor id: 00F7TEST4C00
    Base Operating System Runtime AIX version: 06.01.0007.0015
    TCP/IP Client Support version: 06.01.0007.0016"

    On other machines where SNMPWALK is installed the following commands can be executed for verification.

    # snmpwalk -v 1 -c hmsnmp 192.0.246.23 1.3.6.1.2.1.1.1.0
    
    SNMPv2-MIB::sysDescr.0 = STRING: IBM PowerPC CHRP Computer
    Machine Type: 0x0800004c Processor id: 00F7TEST4C00
    Base Operating System Runtime AIX version: 06.01.0007.0015
    TCP/IP Client Support version: 06.01.0007.0016

    2, MIB OID commonly used in AIX
    Above, we configured the value of SNMP Community: hmsnmp, which can be used to monitor SNMP-related services of the tool.
    If you need to find the OID of an object, you can go to /etc/mib.defs to find the corresponding object, and then snmpinfo -md ObjectName to get the corresponding OID for remote call.

    2×1 Display CPU usage

    # snmpinfo -md -v -c hmsnmp aixSeCPUUtilization
    
    aixSeCPUUtilization.0 = 5

    Remove the -v parameter and you see the OID value.

    # snmpinfo -md -c hmsnmp aixSeCPUUtilization
    
    1.3.6.1.4.1.2.6.191.1.2.1.0 = 5

    2×2 Show Paging Space

    # snmpinfo -md -v -c hmsnmp aixPagingSpace
    
    aixPageThreshold.0 = 95
    aixPageName.1 = "hd6"
    aixPageNameVG.1 = "rootvg"
    aixPageNamePV.1 = "hdisk0"
    aixPageSize.1 = 14336
    aixPagePercentUsed.1 = 1
    aixPageStatus.1 = 1
    aixPageType.1 = 1
    aixPageIndex.1 = 1

    2×3 View the serial number of the machine

    # snmpinfo -md -v -c hmsnmp aixSeMachineType
    
    aixSeMachineType.0 = "IBM,8205-E6C"
    
    # snmpinfo -md -v -c hmsnmp aixSeSerialNumber
    
    aixSeSerialNumber.0 = "IBM,0210TESTR"

    2×4 View CPU count

    # snmpinfo -md -v -c hmsnmp aixSeNumCPUs
    
    aixSeNumCPUs.0 = 4

    2×5 View VG-related information: aixVolumeGroup

    2×6 View LV-related information: aixLogicalVolume

    2×7 View PV-related information: aixPhysicalVolume

    2×8 View FS-related information: aixFileSystem

    3, A simple case of system monitoring via SNMP

    If you are just doing a simple monitoring, then you can write your own shell script.

    Let’s write a shell script, AIX_FS_CHECK.sh, which is deployed on the monitor, using the usage of the monitor file system as an example.

    In order to see the actual output, we set the threshold to a low value in the script, if you are interested, you can also bring the threshold as a parameter in the script.

    # . /AIX_FS_CHECK.sh -h 192.0.246.23 -c hmsnmp
    
    WARNING!!! /usr used 74%
    WARNING!!! /usr Inodes used 18%
    WARNING!!! /patch used 97%

    The monitor smoothly gets the information of the monitored device through SNMP and sends the relevant alarm information according to our request.

    4, Summary

    This article introduces the method of monitoring AIX system using SNMP protocol. Although there is still a long way to realize the monitoring of various indicators, flexibility and ease of use should be improved, but it provides a way of thinking to realize the monitoring of the operating system in an agentless way, I hope to bring some help to those who need it.

    5, Additional

    Alternatively, there is another way to use the conf file I provided directly, which of course requires you to modify the community and IP address.

    5×1 Stop service.

    stopsrc -s snmpd

    5×2 Modify the conf file, replace the original conf file, and remember to back it up before replacing it.

    5×3 Start service.

    startsrc -s snmpd

    snmpd.conf content:

    ###############################################################################
    #
    # EXAMPLE.conf:
    #   An example configuration file for configuring the Net-SNMP agent ('snmpd')
    #   See the 'snmpd.conf(5)' man page for details
    #
    #  Some entries are deliberately commented out, and will need to be explicitly activated
    #
    ###############################################################################
    #
    #  AGENT BEHAVIOUR
    #
    
    #  Listen for connections from the local system only
    #agentAddress  udp:127.0.0.1:161
    #  Listen for connections on all interfaces (both IPv4 *and* IPv6)
    agentAddress udp:161,udp6:[::1]:161
    
    
    
    ###############################################################################
    #
    #  SNMPv3 AUTHENTICATION
    #
    #  Note that these particular settings don't actually belong here.
    #  They should be copied to the file /var/net-snmp/snmpd.conf
    #     and the passwords changed, before being uncommented in that file *only*.
    #  Then restart the agent
    
    #  createUser authOnlyUser  MD5 "remember to change this password"
    #  createUser authPrivUser  SHA "remember to change this one too"  DES
    #  createUser internalUser  MD5 "this is only ever used internally, but still change the password"
    
    #  If you also change the usernames (which might be sensible),
    #  then remember to update the other occurances in this example config file to match.
    
    
    
    ###############################################################################
                                                     #     Remember to activate the 'createUser' lines above
    #  ACCESS CONTROL
    #
    
                                                     #  Default access to basic system info
    view systemonly internet                    - included -
    view systemonly 1.3.6.1.4.1.2               - included -
    view systemonly 1.3.6.1.4.1.2.2             - included -
    view systemonly 1.3.6.1.4.1.2.3             - included -
    view systemonly 1.3.6.1.4.1.2.5             - included -
    view systemonly 1.3.6.1.4.1.2.6             - included -
    view systemonly directory                   - included -
    view systemonly mgmt                        - included -
    view systemonly mib-2                       - included -
    view systemonly system                      - included -
    view systemonly aix                         - included -
    view systemonly 1.3.6.1.4                   - included -
    view systemonly 1.3.6.1.6                   - included -
    view systemonly 1.3.6.1.6.3.1.1.5           - included -
    view systemonly 1.3.6.1.4.1.2021            - included -
    view systemonly 1.3.6.1.4.1.2.3.1.2.2.2.1.4 - included -
    
    # Include aixmibd managed MIBS with this view
    view systemonly 1.3.6.1.4.1.2.6.191         - included -
    
    #view   systemonly  included   .1.3.6
    #view   systemonly  included   .1.3.6.1.4.1.2021.10.1.3.1
    #view   systemonly  included   .1.3.6.1.4.1.2021.11.9.0
    #view   systemonly  included   .1.3.6.1.4.1.2021.11.11.0
    #view   systemonly  included   .1.3.6.1.4.1.2021.9
    #view   systemonly  included   .1.3.6.1.2.3.1.2.1.2
    #view   systemonly  included   .1.3.6.1.4.1.2.3.1.2.2.1.1.2
    #view   systemonly  included   .1.3.6.1.2.1.1
    #view   systemonly  included   .1.3.6.1.2.1.25.1
    
                                                     #  Full access from the local host
    #rocommunity public  localhost
                                                     #  Default access to basic system info
    # rocommunity public  default    -V systemonly
    rocommunity public
    
                                                     #  Full access from an example network
                                                     #     Adjust this network address to match your local
                                                     #     settings, change the community string,
                                                     #     and check the 'agentAddress' setting above
    #rocommunity secret  10.0.0.0/16
    
                                                     #  Full read-only access for SNMPv3
     rouser   authOnlyUser
                                                     #  Full write access for encrypted requests
                                                     #     Remember to activate the 'createUser' lines above
    #rwuser   authPrivUser   priv
    
    #  It's no longer typically necessary to use the full 'com2sec/group/access' configuration
    #  r[ou]user and r[ow]community, together with suitable views, should cover most requirements
    
    
    
    ###############################################################################
    #
    #  SYSTEM INFORMATION
    #
    
    #  Note that setting these values here, results in the corresponding MIB objects being 'read-only'
    #  See snmpd.conf(5) for more details
    sysLocation    Sitting on the Dock of the Bay
    sysContact     Me <me@example.org>
                                                     # Application + End-to-End layers
    sysServices    72
    
    
    #
    #  Process Monitoring
    #
                                   # At least one  'mountd' process
    proc  mountd
                                   # No more than 4 'ntalkd' processes - 0 is OK
    proc  ntalkd    4
                                   # At least one 'sendmail' process, but no more than 10
    proc  sendmail 10 1
    
    #  Walk the UCD-SNMP-MIB::prTable to see the resulting output
    #  Note that this table will be empty if there are no "proc" entries in the snmpd.conf file
    
    
    #
    #  Disk Monitoring
    #
                                   # 10MBs required on root disk, 5% free on /var, 10% free on all other disks
    disk       /     10000
    disk       /var  5%
    disk       /usr  10000
    includeAllDisks  10%
    
    #  Walk the UCD-SNMP-MIB::dskTable to see the resulting output
    #  Note that this table will be empty if there are no "disk" entries in the snmpd.conf file
    
    
    #
    #  System Load
    #
                                   # Unacceptable 1-, 5-, and 15-minute load averages
    load   12 10 5
    
    #  Walk the UCD-SNMP-MIB::laTable to see the resulting output
    #  Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file
    
    
    
    ###############################################################################
    #
    #  ACTIVE MONITORING
    #
    
                                        #   send SNMPv1  traps
     trapsink     localhost public
                                        #   send SNMPv2c traps
    #trap2sink    localhost public
                                        #   send SNMPv2c INFORMs
    #informsink   localhost public
    
    #  Note that you typically only want *one* of these three lines
    #  Uncommenting two (or all three) will result in multiple copies of each notification.
    
    
    #
    #  Event MIB - automatically generate alerts
    #
                                       # Remember to activate the 'createUser' lines above
    iquerySecName   internalUser       
    rouser          internalUser
                                       # generate traps on UCD error conditions
    defaultMonitors          yes
                                       # generate traps on linkUp/Down
    linkUpDownNotifications  yes
    
    
    
    ###############################################################################
    #
    #  EXTENDING THE AGENT
    #
    
    #
    #  Arbitrary extension commands
    #
     extend    test1   /bin/echo  Hello, world!
     extend-sh test2   echo Hello, world! ; echo Hi there ; exit 35
    #extend-sh test3   /bin/sh /tmp/shtest
    
    #  Note that this last entry requires the script '/tmp/shtest' to be created first,
    #    containing the same three shell commands, before the line is uncommented
    
    #  Walk the NET-SNMP-EXTEND-MIB tables (nsExtendConfigTable, nsExtendOutput1Table
    #     and nsExtendOutput2Table) to see the resulting output
    
    #  Note that the "extend" directive supercedes the previous "exec" and "sh" directives
    #  However, walking the UCD-SNMP-MIB::extTable should still returns the same output,
    #     as well as the fuller results in the above tables.
    
    
    #
    #  "Pass-through" MIB extension command
    #
    #pass .1.3.6.1.4.1.8072.2.255  /bin/sh       PREFIX/local/passtest
    #pass .1.3.6.1.4.1.8072.2.255  /usr/bin/perl PREFIX/local/passtest.pl
    
    # Note that this requires one of the two 'passtest' scripts to be installed first,
    #    before the appropriate line is uncommented.
    # These scripts can be found in the 'local' directory of the source distribution,
    #     and are not installed automatically.
    
    #  Walk the NET-SNMP-PASS-MIB::netSnmpPassExamples subtree to see the resulting output
    
    
    #
    #  AgentX Sub-agents
    #
                                               #  Run as an AgentX master agent
     master          agentx
                                               #  Listen for network connections (from localhost)
                                               #    rather than the default named socket /var/agentx/master
    #agentXSocket    tcp:localhost:705
    
    #proxy -v 1 -c public 127.0.0.1:1610 .1.3.6.1.4.1.2021.9
  • 许多年前

    术业有专攻

    许多年前,拥有一个属于自己域名的博客是一件很幸福的事情。那时并不太懂如何搭建网站,另外也是囊中羞涩,为在这个虚拟的世界里建造一个家园就像年轻时买房一样的不敢奢望。

    随着时间的流逝,一切皆有了条件。

    也就有了这个家园。

    而许多年前的起点,开始于TOM 博客,时间大约是2004年。有学生时代一些作品的重新发布,也有大量的新创作。大概过了短短1、2年的样子,疏于维护的某日发现TOM 关停了博客。当时没有任何备份,心如死灰,心痛得无法呼吸。

    后来再就是博客大巴,Blogbus ,重整旗鼓,大量文章在此期间创作。很欣喜的一点就是可以用子域名了,算是不小的进步。同时也开始使用谷歌的广告平台满心希望的赚一笔钱,可是就像是三体人锁定地球人科技一样,5美刀坚挺了好多年。

    博客大巴期间也是博客市场井喷的时间,那期间也有尝试其他平台,Opera Blog、Blogspot、还有一些论坛衍生的博客,例如ChinaUnix 的博客,也都多多少少有所接触。

    那段日子的博客更新还是很快的,虽然谷歌广告没怎么赚钱,但是百度搜索一直是排名很靠前。甚至有朋友要建站还从我这里抓过大量文章。但是随着国家监管越来越严格,很多关键字不允许发布,甚至后来绞尽脑汁也不知道敏感词汇是什么的时候,也就是准备放弃写博客的时候了。

    再后来博客大巴也要关停,好在我已及时得到消息,尽快的进行备份,并且在其他后来的博客产品中恢复,例如网易和旗下的Lofter。

    但是恢复的博客文章并不完整,这块心病只能交给时间来处理,毕竟经历过了TOM,还算坦然。

    时至今日,终于有了自己的空间,并且坚持不备案(不知还能坚持多久:D ),也算是有了归宿。

    写于2020年3月25日国内疫情尾声、得知同事准备离职回老家发展的夜晚,有感而发。虽然不舍,但如果离开能让你更好,我也就不再挽留。祝你一切顺利。你永远是我们的一哥!

  • 升级SolarWinds的好处

    前两天有客户问我为什么要升级SolarWinds,升级SolarWinds可以带来什么好处,很显然,问这种问题的用户通常有这样的一个特点:稳定性是首要考虑因素,而对新的功能并不感冒。可是,您每年续费的SolarWinds的其中一个很重要的价值就是他每次更新带来的新功能啊,像吊打竞争对手的NetPath、PerfStack、AppStack这些功能,都是在每次大版本更新时免费提供给用户使用的。而稳定性方面,则完全可以参照微软产品的部署习惯——等足够多的补丁发布之后再转至生产部署——SolarWinds也一样,您可以等hotfix补丁发布3-4个之后进行更新,从这方面避免稳定性的缺失。

    SolarWinds各模块未来新增功能的链接合集:https://thwack.solarwinds.com/t5/Announcements-Discussions/What-We-Are-Working-On/td-p/249938

    好了,其他的不多说了,下面切入正题。

    本文面向的用户群体为使用11.X.X版本(已停止支持)的用户们,而目前最新的SolarWinds版本为2019.4 Hotfix 4

    众所周知,SolarWinds是一款业界口碑良好、市场占有率第一的IT基础架构监控管理解决方案产品,随着近年来的高速发展,SolarWinds开始加入关注前沿技术的DNA,例如思科SD-WAN的监控(基于ACI);并努力的在修正自己产品中曾经的一些弊病,例如Syslog及Trap的保存不再建议存放于SolarWindsOrion库的表中,而是在新的数据库中存储,从而极大的提高了日志的保存及查询能力,不再受限100万行数据限制。

    以下将详细介绍SolarWinds的各项新功能及改进:

    支持Cisco SD-WAN监控

    通过SolarWinds可以同时监控Cisco ACI环境的逻辑及物理两种网络,能够直接找出SDN环境中出现的故障及其时间,并对SDN环境的逻辑组件进行监控,包括APIC、Tenants、应用配置文件、终端组及物理实体。

    另外还可以通过启用APIC上的ACI轮询,监控APIC的健康状况,例如Tenants、Spines和Leaves。也可以根据健康得分计算ACI状态,并使用设备上定义的默认阈值。

    透过SolarWinds Orion Maps功能,可以查看ACI的逻辑关系,可视化组件是如何组合在一起并验证它们是否正确连接是很有挑战性的。使用Orion Maps的智能映射,您可以轻松地生成APIC Tenants、应用配置文件和EPG之间关系的可视化描述。能够在一个单一的平台上一起查看您的逻辑和物理网络,并使用我们的Cisco ACI监控工具查看健康状况和状态的变化。

    支持混合数据交叉展示

    支持将不同设备相同或不同的性能指标统一放置于同一个页面,用于综合交叉性能分析。其数据呈现方式支持交互,便于管理人员确定故障出在哪个环节(网络或者应用)

    深度监控

    针对思科Nexus设备深度监控(Cisco Nexus Insight Monitor),除了基本性能指标监控以外,还支持Nexus设备特有的Virtual Port Channel信息监控,并有增强的接口描述过滤视图,便于快速定位故障接口。


    针对Palo Alto防火墙深度监控(Palo Alto Insight Monitor),除了基本的性能指标监控以外,还支持GlobalProtect VPN、Policies等性能指标。


    针对F5厂商的设备进行深度监控(F5 Insight Monitor),除了基本的性能指标监控以外,还包括设备详细信息,包括主备状态,网络吞吐,连接数,Virtual Server、Pools、Pool Member等性能指标。

    支持HA高可用功能

    支持高可用性,避免单点故障

    支持Web版动态拓扑图及绘制

    用于高级故障追踪的工具,可在设备详情页下调用查看。另外,此功能支持手动及自动发现绘制,可自动关联发现与之相关的路由器、交换机、服务器、接口、磁盘卷及组的物理及逻辑关系,并展示其当前状态。

    支持NetFlow的告警设定

    最新版的NTA模块开始支持告警的设定,可以及时的对网络流量方面的问题进行预警。主要支持:应用阈值告警、应用占比告警、未接收Flow告警、高流量传输对象告警、CBQoS告警等等。

    设备视图

    图形模板显示Cisco 2960和Juniper设备接口物理布局


    实时图表

    可以实时查询设备CPU负载、内存使用、以及接口百分比利用率情况。


    改进:

    改进Syslog及Trap的存储形式

    通过使用新的数据库进行数据保存,既保证了性能又保证了保存周期。

    可与 Orion® Platform 完全集成,并为用户提供实现其日志数据潜力的机制。 使用实时日志收集、分析和可视化功能,您可以享用现成的可见性,直观了解 IT 架构性能和可用性。

    搜索并筛选日志数据,帮助管理员准确定位网络故障,从而降低系统宕机事件,提高网络性能。

    Syslog及SNMP Trap日志收集与分析深入了解网络设备的性能

    您的架构不断地生成日志数据以提供性能洞察力。 收集、合并和分析数千个 Syslog 与 SNMP Trap以执行根源分析。

    实时日志流使用交互式图表和图形实时查看日志数据

    传统的日志收集和管理工具可生成纯文本或 HTML 格式的报告。以交互式实时日志流形式显示日志。

    强大的搜索和筛选功能快速识别性能和可用性问题

    使用基本匹配执行搜索。 使用多个搜索条件执行搜索,并应用过滤器以缩小结果范围 保存、计划和导出搜索结果。

    事件日志标记简化日志搜索

    轻松将(颜色编码)标签应用于日志数据,以帮助筛选、搜索和识别性能问题。

    Orion平台集成统一的架构监控和集中事件日志管理

    创建自定义规则,可以将日志转发到第三方系统

    提高NetPath功能的稳定性及准确性

    自11版本开始,SolarWinds推出了广受好评的NetPath功能,能够基于TCP协议模拟探测源到目的设备或URL所经过的网络设备的路径,可以监控每一个网络节点的响应时间及丢包率状况,并且路径故障可以直接显示在动态展示图中。与NTA及NCM配合使用,展示设备的流量及配置变更信息。

    全新的UI,更加美观及易用

    随着不断的进步,SolarWinds的UI界面开发也在逐年提升,各个模块的风格趋于统一,同时又保留了以前的操作习惯。增加了很多当前流行的特效展示等等。

    新的安装部署模式

    当前的SolarWinds版本不再像以前一样,每个模块一个安装文件,而是将所有模块整合至统一的安装包中,并且版本命名规则也统一,所有模块版本均一致,例如:2019.4。前面的大版本号代表了年,后面的小版本号代表了季度,可以更加直观的了解产品的更新情况。

    提升VMware蔓延信息抓取性能

    持续跟踪监控虚拟机的配置参数,根据重要性能指标判定配置是否是最佳配置,并及时作出更改

  • 人生中场

    自从2004年来北京到现在已经16年了,那些点点滴滴,从中关村开始,菊园、清河、赵庄村、五道口,再回清河,惠新西街,到府学胡同、安宁里,到现在的房山,林萃桥。每一个地方,都是一篇回忆录。

    去年年底的时候曾经跟夫人相约走一走我们曾经经历过的地方,虽然她不曾从起点陪我,但会是那个与我走完一生的人。希望2020年我们能够一起完成这个愿望。

    2020年,这个在当初玩实况足球2009大师联赛时才会经历的年份,转眼间已来到脚下。C罗、伊瓜因、本泽马、马塔、阿隆索、巴拉克、兰帕德、杰拉德、因扎吉、加图索、基耶利尼、安东尼尼、卡卡,有的人还在,有的人却已退役,一茬一茬,一波一波,我们已不再年轻。

    一场比赛,有上半场和下半场,有时候会给我们加时赛的机会,而很多人的人生早已走完上半场,面对质疑的时候,他们并没有沮丧,用精彩的表现征服了所有人。

    下半场开始时,我们该如何合理的分配体能,确保在顺境中可以稳扎稳打,在逆境时绝不放弃,90分钟的时间里,不求证明自己,但求一胜。

    中场休息马上结束,教练,我们准备好了!

  • 告别2019

    杜家坎,冬天,某一个平凡的早上,从桥上望向远方,像极了海边。

    这就是2019,桥梁连接广袤无垠的未来,指引着我前进。

    短暂的驻足,收拾自己的心情,做真正的自己。

    昨夜与夫人的促膝长谈,让未来的影像逐渐显现。

    完成未完成的小说;寻找快乐。