Es hängt vom Systemtyp ab, welche Monitortypen für einen Bestand verfügbar sind und auf welche Art und Weise diese den Test durchführen.
Network Monitor unterstützt alle integrierten Windows-Systemtypen. Neue Systemtypen können mithilfe eines Konfigurationsdateisets erstellt werden, das sich im Ordner KNM\system
des KNM-Hostrechners befindet.
Hinweis: Der Fokus dieses Abschnitts liegt hauptsächlich auf UNIX; die Anweisungen können jedoch auf alle Systemtypen übertragen werden, die über einen Shellzugriff über SSH oder Telnet verfügen.
Systemspezifikationen
Um die Überwachung einer Disk, CPU, Auslagerungsdatei usw. zu ermöglichen, meldet Network Monitor sich mithilfe von SSH oder Telnet an, führt einen Befehl auf dem UNIX-Host aus und analysiert das Ergebnis. Welcher Befehl ausgeführt wird und wie das Ergebnis analysiert wird, ist in den Konfigurationsdateien im Ordner KNM\system
beschrieben.
Alle Systemspezifikationen erben denjenigen, der mit Generic UNIX
beschriftet ist. Es müssen also nur für diejenigen Befehle Analyseinformationen geschrieben werden, die sich von den Befehlen, die im Systemtyp Generic UNIX
festgelegt sind, unterscheiden.
Generische UNIX-Systemdefinitionsdatei
<system name="Generic UNIX" release="" author="Kaseya" type="unix" internalID="5" fileRevision="1">
<parsing>
<!-- disk -->
<disk>
<!-- enumeration of disk volumes -->
<enumeration>
<query>
<command>df</command>
<enumList startLine="2">
<value id="diskVolume" field="1" />
</enumList>
</query>
<result id="volumeID">diskVolume</result>
</enumeration>
<!-- monitoring disk volumes-->
<monitoring>
<!-- free and used disk space -->
<diskSpace>
<query>
<command>df -k $volume</command>
<value id="freeSpace" line="-1" field="-3"/>
<value id="usedSpace" line="-1" field="-4"/>
</query>
<result id="freeSpace" unit="MB">freeSpace / 1024</result>
<result id="usedSpace" unit="MB">usedSpace / 1024</result>
</diskSpace>
</monitoring>
</disk>
<!-- cpu -->
<cpu>
<!-- enumeration of CPU's -->
<enumeration>
<query>
<command>mpstat -P ALL</command>
<enumList startLine="5">
<value id="cpuNumber" field="3" />
</enumList>
</query>
<result id="cpuID">cpuNumber</result>
</enumeration>
<monitoring>
<!-- utilization of given CPU-->
<cpuUtilization>
<query>
<command>mpstat -P $cpu 2 2</command>
<value id="userLoad" line="-1" field="-9"/>
<value id="systemLoad" line="-1" field="-7"/>
</query>
<result id="cpuAverageLoad" unit="%">userLoad + systemLoad</result>
</cpuUtilization>
<!-- overall system CPU load, used if a CPU is not specified -->
<cpuAverageLoad>
<query>
<command>vmstat 2 2</command>
<value id="userLoad" line="-1" field="-5"/>
<value id="systemLoad" line="-1" field="-4"/>
</query>
<result id="cpuAverageLoad" unit="%">userLoad + systemLoad</result>
</cpuAverageLoad>
</monitoring>
</cpu>
<!-- processes -->
<process>
<!-- process enumeration -->
<enumeration>
<query>
<command>ps -awxu</command>
<enumList startLine="2">
<value id="processName" field="11" />
</enumList>
</query>
<result id="processName">processName</result>
</enumeration>
<monitoring>
<!-- checks if a given process is running -->
<processRunning>
<query>
<command>ps -awxu</command>
<value id="processName">
<match type="line">$process</match>
</value>
</query>
<result id="processName">processName</result>
</processRunning>
</monitoring>
</process>
<!-- swap -->
<swap>
<monitoring>
<swapUtilization>
<query>
<command>free -m</command>
<value id="swapUsed" line="-1" field="-3"/>
<value id="swapFree" line="-1" field="-2"/>
</query>
<result id="swapFree" unit="MB">swapFree</result>
<result id="swapUsed" unit="MB">swapUsed</result>
</swapUtilization>
</monitoring>
</swap>
<!-- memory usage -->
<memory>
<monitoring>
<!-- free and used memory -->
<freeMemory>
<query>
<command>free -m</command>
<value id="freeMem" line="3" field="-1"/>
<value id="usedMem" line="3" field="-2"/>
</query>
<result id="freeMemory" unit="MB">freeMem</result>
<result id="usedMemory" unit="MB">usedMem</result>
</freeMemory>
</monitoring>
</memory>
<!-- file change -->
<file>
<monitoring>
<fileChange>
<query>
<command>ls -l --full-time $filename</command>
<value id="fileSize" line="1" field="5"/>
<value id="fileDate" line="1" field="6"/>
<value id="fileTime" line="1" field="7"/>
</query>
<result id="fileSize" unit="B">fileSize</result>
<result id="fileDate">fileDate</result>
<result id="fileTime">fileTime</result>
</fileChange>
</monitoring>
</file>
</parsing>
</system>