VMware ESX

De Wiki de Romain RUDIGER
Aller à : navigation, rechercher

Add stuff in vmimages from an nfs mount

  • Mount your nfs share on /iso_storage
  • Make a symbolic link ln -s /iso_storage /vmimages/iso_storage
  • Authorize the VM to use this file system in /etc/vmware/configrules (rule "Virtual IDE Devices").

Supervise vmfs storage

[root@poweredge poweredge:storage1]# cat /etc/snmp/snmpd.conf
syscontact root@localhost (edit snmpd.conf)
syslocation room1 (edit snmpd.conf)
rocommunity public
trapcommunity public
trapsink localhost

# VMware MIB modules. To enable/disable VMware MIB items
# add/remove the following entries.
dlmod SNMPESX            /usr/lib/vmware/snmp/libSNMPESX.so

# Allow Systems Management Data Engine SNMP to connect to snmpd using SMUX
smuxpeer .1.3.6.1.4.1.674.10892.1

exec .1.3.6.1.4.1.6876.99999.2.1 check_vmfs /bin/bash /etc/snmp/check_vmfs.sh poweredge:storage1
exec .1.3.6.1.4.1.6876.99999.2.2 check_vmfs /bin/bash /etc/snmp/check_vmfs.sh poweredge:storage2
[root@poweredge poweredge:storage1]# cat /etc/snmp/check_vmfs.sh
/usr/sbin/vdf | /bin/sed -e "s/\/vmfs\/volumes\///" -e "s/%//" | grep $1 | /bin/awk '{p_free=100-$4; printf $5"\n"$1"\n"$3"\n"p_free"\n"$4}'
[root@poweredge poweredge:storage1]# service snmpd restart
Stopping snmpd:                                            [  OK  ]
Starting snmpd:                                            [  OK  ]
[root@poweredge poweredge:storage1]# snmpwalk -v2c -c public poweredge .1.3.6.1.4.1.6876.99999
SNMPv2-SMI::enterprises.6876.99999.2.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.6876.99999.2.1.2.1 = STRING: "check_vmfs"
SNMPv2-SMI::enterprises.6876.99999.2.1.3.1 = STRING: "/bin/bash /etc/snmp/check_vmfs.sh poweredge:storage1"
SNMPv2-SMI::enterprises.6876.99999.2.1.100.1 = INTEGER: 0
SNMPv2-SMI::enterprises.6876.99999.2.1.101.1 = STRING: "poweredge:storage1"
SNMPv2-SMI::enterprises.6876.99999.2.1.101.2 = STRING: "177471488"
SNMPv2-SMI::enterprises.6876.99999.2.1.101.3 = STRING: "23763968"
SNMPv2-SMI::enterprises.6876.99999.2.1.101.4 = STRING: "14"
SNMPv2-SMI::enterprises.6876.99999.2.1.101.5 = STRING: "86"
SNMPv2-SMI::enterprises.6876.99999.2.1.102.1 = INTEGER: 0
SNMPv2-SMI::enterprises.6876.99999.2.2.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.6876.99999.2.2.2.1 = STRING: "check_vmfs"
SNMPv2-SMI::enterprises.6876.99999.2.2.3.1 = STRING: "/bin/bash /etc/snmp/check_vmfs.sh poweredge:storage2"
SNMPv2-SMI::enterprises.6876.99999.2.2.100.1 = INTEGER: 0
SNMPv2-SMI::enterprises.6876.99999.2.2.101.1 = STRING: "poweredge:storage2"
SNMPv2-SMI::enterprises.6876.99999.2.2.101.2 = STRING: "27525120"
SNMPv2-SMI::enterprises.6876.99999.2.2.101.3 = STRING: "26799104"
SNMPv2-SMI::enterprises.6876.99999.2.2.101.4 = STRING: "98"
SNMPv2-SMI::enterprises.6876.99999.2.2.101.5 = STRING: "2"
SNMPv2-SMI::enterprises.6876.99999.2.2.102.1 = INTEGER: 0