霜拶仰鴬

This is the documentation page for an unsupported version of 霜拶仰鴬.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

16 VMware のカスタム パフォ`マンス カウンタ`兆恬撹

古勣

VMware パフォ`マンス カウンタ` パスのフォ`マットはgroup/counter[rollup]です。

  • group - cpu などのパフォ`マンス カウンタ` グル`プ
  • counter - usagemhz などのパフォ`マンス カウンタ`兆
  • rollup - averageなどのパフォ`マンス カウンタ` ロ`ルアップのN

貧の箭では肝のカウンタ` パスが誼られます: cpu/usagemhz[average]

パフォ`マンス カウンタ` グル`プのh苧、カウンタ`兆、およびロ`ルアップのNについては、を歌孚してください。

霜拶仰鴬 のスクリプト アイテムを聞喘して、坪何兆を函誼し、カスタム パフォ`マンス カウンタ`兆を恬撹することもできます。

譜協

  1. 肝のパラメ`タ`を聞喘して、メインの VMware ホスト (eventlog[] アイテムが贋壓する侭) でo浸されたスクリプト アイテムを恬撹します。

  • 兆念: VMware metrics
  • タイプ: スクリプト
  • キ`: vmware.metrics
  • デ`タ侏: テキスト
  • スクリプト: 參和の スクリプト をコピ`して薮り原けます
  • タイムアウト: 10
  • ヒストリの隠贋豚寂: ヒストリを隠隔しない
  • : チェックしない

スクリプト

try {
           霜拶仰鴬.log(4, 'vmware metrics script');
       
           var result, resp,
           req = new HttpRequest();
           req.addHeader('Content-Type: application/xml');
           req.addHeader('SOAPAction: "urn:vim25/6.0"');
       
           login = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:vim25">\
           <soapenv:Header/>\
           <soapenv:Body>\
               <urn:Login>\
                   <urn:_this type="SessionManager">SessionManager</urn:_this>\
                   <urn:userName>{$VMWARE.USERNAME}</urn:userName>\
                   <urn:password>{$VMWARE.PASSWORD}</urn:password>\
               </urn:Login>\
           </soapenv:Body>\
       </soapenv:Envelope>'
           resp = req.post("{$VMWARE.URL}", login);
           if (req.getStatus() != 200) {
               throw 'Response code: '+req.getStatus();
           }
       
           query = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:vim25">\
       <soapenv:Header/>\
           <soapenv:Body>\
               <urn:RetrieveProperties>\
                   <urn:_this type="PropertyCollector">propertyCollector</urn:_this>\
                   <urn:specSet>\
                       <urn:propSet>\
                          <urn:type>PerformanceManager</urn:type>\
                          <urn:pathSet>perfCounter</urn:pathSet>\
                       </urn:propSet>\
                       <urn:objectSet>\
                          <urn:obj type="PerformanceManager">PerfMgr</urn:obj>\
                       </urn:objectSet>\
                   </urn:specSet>\
               </urn:RetrieveProperties>\
           </soapenv:Body>\
       </soapenv:Envelope>'
           resp = req.post("{$VMWARE.URL}", query);
           if (req.getStatus() != 200) {
               throw 'Response code: '+req.getStatus();
           }
           霜拶仰鴬.log(4, 'vmware metrics=' + resp);
           result = resp;
       
           logout = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:vim25">\
           <soapenv:Header/>\
           <soapenv:Body>\
               <urn:Logout>\
                   <urn:_this type="SessionManager">SessionManager</urn:_this>\
               </urn:Logout>\
           </soapenv:Body>\
       </soapenv:Envelope>'
       
           resp = req.post("{$VMWARE.URL}",logout);         
           if (req.getStatus() != 200) {
               throw 'Response code: '+req.getStatus();
           }
       
       } catch (error) {
           霜拶仰鴬.log(4, 'vmware call failed : '+error);
           result = {};
       }
       
       return result;

朕を譜協瘁、テスト ボタンを兀して、、糧ゝ を兀します。

鞭佚した XML を販吭の XML フォ`マッタ`にコピ`し、朕議のメトリックをつけます。

1 つのメトリックの XML の箭:

<PerfCounterInfo xsi:type="PerfCounterInfo">
           <key>6</key>
           <nameInfo>
               <label>Usage in MHz</label>
               <summary>CPU usage in megahertz during the interval</summary>
               <key>usagemhz</key>
           </nameInfo>
           <groupInfo>
               <label>CPU</label>
               <summary>CPU</summary>
               <key>cpu</key>
           </groupInfo>
           <unitInfo>
               <label>MHz</label>
               <summary>Megahertz</summary>
               <key>megaHertz</key>
           </unitInfo>
           <rollupType>average</rollupType>
           <statsType>rate</statsType>
           <level>1</level>
           <perDeviceLevel>3</perDeviceLevel>
       </PerfCounterInfo>

XPath を聞喘して、鞭佚した XML からカウンタ` パスを渇竃します。 貧の箭では、XPath は肝のようになります:

フィ`ルド xPath
group //groupInfo[../key=6]/key cpu
counter //nameInfo[../key=6]/key usagemhz
rollup //rollupType[../key=6] average

このY惚の栽のパフォ`マンス カウンタ` パスは肝のとおりです: cpu/usagemhz[average]