Skip to content

Commit

Permalink
[feature] added more metrics for DVS
Browse files Browse the repository at this point in the history
  • Loading branch information
Tesifonte Belda committed Feb 12, 2023
1 parent c76f5f9 commit c90f456
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions METRICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@
- fields:
- status (string)
- status_code (int) 0-green, 1-gray, 2-yellow, 3-red
- num_hosts (int)
- num_ports (int)
- max_ports (int)
- num_standalone_ports (int)
- pnic_capacity_ratio_for_reservation (int)
- vcstat_net_dvp
- tags:
- dvp
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ vcstat_host_nic,dcname=MyDC,clustername=MyCluster-01,device=vmnic0,driver=ntg3,e
vcstat_host_esxcli,dcname=MyDC,clustername=MyCluster-01,esxhostname=myesxi01.local,moid=host-706,vcenter=vcenter.local responding_code=0i,response_time_ns=109185876i 1653060681000000000
vcstat_host_service,dcname=MyDC,clustername=MyCluster-01,esxhostname=myesxi01.local,key=ntpd,vcenter=vcenter.local label="NTP Daemon",policy="on",required=false,running=true 1653060681000000000
vcstat_host_service,dcname=MyDC,clustername=MyCluster-01,esxhostname=myesxi01.local,key=vpxa,vcenter=vcenter.local label="VMware vCenter Agent",policy="on",required=false,running=true 1653060681000000000
vcstat_net_dvs,dcname=MyDC,dvs=DSwitch-E1,moid=dvs-e1,vcenter=vcenter.local num_standalone_ports=0i,status="green",status_code=0i,num_ports=421i,max_ports=2147483647i 1653060682000000000
vcstat_net_dvs,dcname=MyDC,dvs=DSwitch-E1,moid=dvs-e1,vcenter=vcenter.local num_hosts=1i,num_standalone_ports=0i,status="green",status_code=0i,num_ports=421i,max_ports=2147483647i,pnic_capacity_ratio_for_reservation=1i 1653060682000000000
vcstat_net_dvp,dcname=MyDC,dvp=DSwitch-E1-DVUplinks-e1,moid=dvportgroup-e1,uplink=true,vcenter=vcenter.local status="green",status_code=0i,num_ports=16i 1653060682000000000
vcstat_datastore,dcname=MyDC,dsname=DS_Departement1,moid=datastore-725,type=VMFS,vcenter=vcenter.local accessible=true,capacity=2198754820096i,freespace=730054262784i,uncommitted=20511i,maintenance_mode="normal"
vcstat_vm,clustername=MyCluster-01,dcname=MyDC,esxhostname=myesxi01.local,moid=vm-4524,vcenter.local,vmname=vmserver01 status="green",status_code=0i,consolidation_needed=false,max_cpu_usage=11972i,num_eth_cards=1i,num_vdisks=2i,connection_state_code=0i,max_mem_usage=8589934592i,num_vcpus=4i,power_state_code=0i,template=false,connection_state="connected",memory_size=8589934592i,power_state="poweredOn" 1653060683000000000
Expand Down
2 changes: 2 additions & 0 deletions internal/vccollector/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ func (c *VcCollector) CollectNetDVS(
dvstags["vcenter"] = c.client.Client.URL().Host

dvsfields["max_ports"] = dvsConfig.MaxPorts
dvsfields["num_hosts"] = len(dvsConfig.Host)
dvsfields["num_ports"] = dvsConfig.NumPorts
dvsfields["num_standalone_ports"] = dvsConfig.NumStandalonePorts
dvsfields["pnic_capacity_ratio_for_reservation"] = dvsConfig.PnicCapacityRatioForReservation
dvsfields["status"] = string(dvs.OverallStatus)
dvsfields["status_code"] = entityStatusCode(dvs.OverallStatus)

Expand Down

0 comments on commit c90f456

Please sign in to comment.