انجمن مدیران و راهبران شبکه

انجمن مدیران و راهبران شبکه

Network Managers and Administrators
انجمن مدیران و راهبران شبکه

انجمن مدیران و راهبران شبکه

Network Managers and Administrators

پیکربندی پروتکل SNMP روی VMWare vCenter Appliance

بدون مقدمه  و  بی حرف پیش اگر قصد اضافه کردن سرور vCenter در سامانه های مانیتورینگ شبکتون رو دارید. برای تنظیم پارامتر های SNMP می تونید مراحل زیر رو انجام بدید :

  •  ابتدا از طریق پروتکل SSH  به ترمینال وی سنتر وصل بشید.
VMware vCenter Server Appliance 6.7.0.31000
Type: vCenter Server with an embedded Platform Services Controller
Connected to service
    * List APIs: "help api list"
    * List Plugins: "help pi list"
    * Launch BASH: "shell"

Command> 
  • اطلاعات Community پروتکل SNMP  و آدرس سرور مانیتورینگ ( مثلا Solarwinds یا Zabbix ) رو بوسیله دستورات زیر تنظیم کنید:
Command> snmp.enable
Command> snmp.set --communities public
Command> snmp.set --targets 192.168.1.254@162/public
  • برای چک کردن پیکربندی و تنظیمات پروتکل SNMP از دستور زیر استفاده کنید:
Command> snmp.get
Config:
   Users:
   V3targets:
   Engineid: 80001adc80ca1f753fff9d0b5d00000000
   Targets:
     1:
         Community: public
         Ip: 192.168.1.254
         Port: 162
   Syslocation: ''
   Loglevel: warning
   Privacy: none
   Processlist: False
   Pid: 19160
   Authentication: none
   Port: 161
   Enable: True
   Syscontact: ''
   Notraps: ''
   Remoteusers:
   Communities: public
Command> snmp.test
Results:
   Message: A warmStart notification was sent to 1 target.
   Success: True

جمع آوری برخی دستورات تست و رفع مشکل شبکه در ترمینال Shell هاست ESXi و ‌VMWare vCenter

VMware network test commands


ESXi

ESXi has two helpful commands.  For basic connectivity tests, vmkping is awesome because it’s simple to use and to specify which kernel port group you want to test.  Sure, you could use ping, but you can’t specify which vmk interface with it.

To ping 192.168.1.1 with your Management Port group, assuming it’s default, so it’s using vmk0, it’s simply:

vmkping 192.168.1.1 -I vmk0

Another good use is validating jumbo frames, as you can specify the packet size as well and disable packet fragmentation.  To conduct the same test with a packet size of 9000 and ensure the packet doesn’t get fragmented:

vmkping 192.168.1.1 -I vmk0 -s 9000 -d

For testing specific port connectivity, ESXi does support the netcat, aka nc command.  To test port 80 on destination 192.168.1.1:

nc -z 192.168.1.1 80

You can specify UDP mode using -u as well.  Note that at least in my experience -s <source IP> does NOT work, so I don’t believe it’s possible to specifically direct netcat through a specific vmkernel port.  When I tried it for example forcing it through an IP that shouldn’t work, connectivity was still made when it shouldn’t have.

Any VMware Product Running on Windows 2012 or Higher (vCenter, SRM)

Everybody knows ping.  I’m not gonna go over that.  But did you know that PowerShell has a ping cmdlet?  This is useful for documentation of results, using export-csv, and scripting lots of ping tests.

To ping 192.168.1.1:

test-connection 192.168.1.1

Another handy trick is you can remotely have multiple Windows machines ping the same computer and/or specify multiple targets.  For example, if I want server1, server2, to ping 192.168.1.1 and 192.168.1.2:

test-connection -Source Server1,Server2 -ComputerName server3,server4

PowerShell also has cmdlets to test network port connectivity as well.  To test if the local machine can connect to 192.168.1.1 on TCP port 80:

test-netconnection -computername 192.168.1.1 -InformationLevel detailed -port 80

Unfortunately, there isn’t a handy -source parameter, but you could use PowerShell remoting to run this command on multiple remote computers, too.

VMware vCenter Server Appliance

For pinging, there’s the ping command.  That’s easy enough.

If you try to use netcat for port testing, it isn’t there by default.  You have to run the following to temporarily install it on version 6:

/etc/vmware/gss-support/install.sh

Rebooting the VCSA removes it.

You can also use curl if that’s something you’d rather not do:

curl -v telnet://192.168.1.1:80

vSphere Replication Appliance

For pinging, there’s the ping command.  No surprises.

For network port testing, again, netcat isn’t installed, nor is there a supported way to install it to my knowledge.  Instead, use the curl command:

curl -v telnet://192.168.1.1:80

Keep checking back, as I add more.