Re: Monitoring disk & CPU usage on FreeBSD systems

Yusufdeen <[email protected]> Wed, 12 Sep 2018 20:50:16 +0800
Newsgroups gmane.network.opennms.general
Message-ID <CAGRa2Gspq5oOLVrWGz9LNW8wHC_-hQon+W83EXEJ-iF1VY-6Vg@mail.gmail.com>
Dear Jonathan,

I am really appreciated for your support.

I have attached complete file of thresholds for your reference.

Regarding netsnmp calculation, *Ubuntu 16.0.4 LTS* (if the HDD is full,
OpenNMS calculated 95%) & *FreeBSD* (If the HDD is full, OpenNMS calculated
92% ).I have asked question to OpenNMS forum.

https://sourceforge.net/p/opennms/mailman/message/35916349/

i felt very harder to adjust the calculation used in the thresholds config.

* Thanks & Regards,*
*Yusufdeen*




On Wed, Sep 12, 2018 at 5:47 PM Jonathan Heard <
[email protected]> wrote:

> Hi Yusufdeen,
>
>    The extract you've provided from thresholds.xml seems to be incomplete
> - please can you try resending it, or share the whole file?
>
> Regarding the NetSNMP calculations - I believe you can adjust the
> calculation used in the Thresholds config, but my guess is that this could
> be similar to Solaris (which is closely related to BSD) which reserves a
> bit of disk space and reports 100% full to non-root users when the disk
> actually has a little bit of space left which root is able to use.
>
> Regards
>
> Jonathan
>
> On 12/09/18 03:47, Yusufdeen wrote:
>
>
> Dear Friends,
>
> We have an FreeBSD Operating System,i want to monitor disk & CPU usage.
>
> i).First i have enable netsnmp to one of my FreeBSD operating
> system.OpenNMS seems to be calculate incorrect disk percentage value Eg:if
> the harddisk is full ,opennms shows/calculate  *92 %*  (8 %
> difference).Received thresholds alert as normal.
> ii) i have disable netsnmp and enable BSNMP to  FreeBSD  OS. OpenNMS
> calculate accurate disk percentage .
>
> *The problem is unable to get disk alert,if the HDD met above the
> thresholds.*
>
> Here i have list out some setting i did in the OpenNMS
>
> a)First,I just created a new *systemDef* in
> */usr/share/opennms/etc/datacollection/netsnmp.xml*
>
>  <systemDef name="BSNMP">
>         <sysoidMask>.1.3.6.1.4.1.12325.1.</sysoidMask>
>         <collect>
>         <includeGroup>mib2-host-resources-system</includeGroup>
>         <includeGroup>mib2-host-resources-memory</includeGroup>
>         <includeGroup>mib2-X-interfaces</includeGroup>
>         <includeGroup>net-snmp-disk</includeGroup>
>         <includeGroup>net-snmp-disk-more</includeGroup>
>         <includeGroup>net-snmp-disk-highlow</includeGroup>
>         <includeGroup>ucd-loadavg</includeGroup>
>         <includeGroup>ucd-memory</includeGroup>
>         <includeGroup>ucd-sysstat</includeGroup>
>         <includeGroup>ucd-sysstat-raw</includeGroup>
>         <includeGroup>ucd-sysstat-raw-more</includeGroup>
>         <includeGroup>ucd-diskio</includeGroup>
>         </collect>
>       </systemDef>
> </datacollection-group>
>
> b)Second,i have created thresholds in /
> *usr/share/opennms/etc/thresholds.xml*
>
> <group name="BSNMP" rrdRepository="/var/lib/opennms/rrd/snmp/">
>       <threshold description="Trigger an alert when the percentage of disk
> space" type="high" ds-type="hrStorageFBSD" value="90.0" rearm="85.0"
> trigger="2" ds-label=" ns-dskPat$
>       <threshold description="Trigger an alert when the percentage of
> inodes used on any disk (excluding the specified special paths) reaches or
> goes above 90% for two consecut$
>          <resource-filter
> field="ns-dskPath">^(?:(?!(/proc|/sys|/dev/pts)).)+$</resource-filter>
>       </threshold>
>       <expression description="Trigger an alert when the amount of unused
> real/physical memory expressed as a percentage of total system memory
> reaches or goes below 5% for two$
>    </group>
> </thresholding-config>
>
>
> Kindly assist me to get alert.
>
> Thanks & Regards,
>      Yusuf
>
>
>

-- 


*Warm Regards,*

_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-discuss mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-discuss
thresholds.xml (text/xml, 11.2 KB)
<thresholding-config xmlns="http://xmlns.opennms.org/xsd/config/thresholding">
   <group name="mib2" rrdRepository="/var/lib/opennms/rrd/snmp/">
      <threshold description="Trigger an alert if one or more incoming packets on the whole node were not received due to an error for one measurement interval" type="high" ds-type="node" value="1.0" rearm="0.0" trigger="1" filterOperator="OR" ds-name="tcpInErrors"/>
      <expression description="Trigger an alert if one or more incoming or outgoing packets on an interface were not transmitted due to error for two consecutive measurement intervals" type="high" ds-type="if" value="1.0" rearm="0.0" trigger="2" ds-label="ifName" filterOperator="OR" expression="ifInErrors + ifOutErrors"/>
      <expression description="Trigger an alert if one or more incoming or outgoing packets on an interface were discarded even though no errors were detected (possibly to free up buffer space) for two consecutive measurement intervals" type="high" ds-type="if" value="1.0" rearm="0.0" trigger="2" ds-label="ifName" filterOperator="OR" expression="ifInDiscards + ifOutDiscards"/>
      <expression description="Trigger an alert if incoming usage of any interface reaches or goes above 90% of its maximum speed for three consecutive measurement intervals (only for interfaces that have a maximum speed value defined)" type="high" ds-type="if" value="90.0" rearm="75.0" trigger="3" ds-label="ifName" filterOperator="OR" expression="ifInOctets * 8 / 1000000 / ifHighSpeed * 100">
         <resource-filter field="ifHighSpeed">^[1-9]+[0-9]*$</resource-filter>
      </expression>
      <expression description="Trigger an alert if outgoing usage of an interface reaches or goes above 90% of its maximum speed for three consecutive measurement intervals (only for interfaces that have a maximum speed value defined)" type="high" ds-type="if" value="90.0" rearm="75.0" trigger="3" ds-label="ifName" filterOperator="OR" expression="ifOutOctets * 8 / 1000000 / ifHighSpeed * 100">
         <resource-filter field="ifHighSpeed">^[1-9]+[0-9]*$</resource-filter>
      </expression>
   </group>
   <group name="hrstorage" rrdRepository="/var/lib/opennms/rrd/snmp/">
      <expression description="Trigger an alert when the percentage of disk space used reaches or goes above 90% for two consecutive measurement intervals (only for disks of type hrStorageFixedDisk, such as a locally attached or USB-attached hard disk)" type="high" ds-type="hrStorageIndex" value="95.0" rearm="90.0" trigger="2" ds-label="hrStorageDescr" filterOperator="OR" expression="hrStorageUsed / hrStorageSize * 100.0">
         <resource-filter field="hrStorageType">^\.1\.3\.6\.1\.2\.1\.25\.2\.1\.4$</resource-filter>
      </expression>
      <expression description="Trigger an alert when the percentage of disk space used increases by a relative 33.3% compared to its most recent previous measurement (e.g. there is suddenly less free space) (only for disks of type hrStorageFixedDisk, such as a locally attached or USB-attached hard disk)" type="relativeChange" ds-type="hrStorageIndex" value="1.333" rearm="0.0" trigger="1" ds-label="hrStorageDescr" filterOperator="OR" expression="hrStorageUsed / hrStorageSize * 100.0">
         <resource-filter field="hrStorageType">^\.1\.3\.6\.1\.2\.1\.25\.2\.1\.4$</resource-filter>
      </expression>
   </group>
   <group name="cisco" rrdRepository="/var/lib/opennms/rrd/snmp/">
      <threshold description="Trigger an alert when the five minute exponentially-decayed moving average of the CPU busy percentage metric on a Cisco device reaches or goes above 80% for three measurement intervals" type="high" ds-type="node" value="80.0" rearm="50.0" trigger="3" filterOperator="OR" ds-name="avgBusy5"/>
      <threshold description="Trigger an alert when the five minute memory pool percentage utilization metric on a Cisco device increases by 25% in one measurement interval" type="relativeChange" ds-type="ciscoMemoryPoolType" value="0.25" rearm="0.0" trigger="1" ds-label="cscoMemoryPoolName" filterOperator="OR" ds-name="cscoMemPoolUtl5Min"/>
      <threshold description="Trigger an alert when the temperature metric on a Cisco device reaches or goes above 55 degrees Celcius for three measurement intervals" type="high" ds-type="ciscoEnvMonTemperatureStatusIndex" value="55.0" rearm="50.0" trigger="3" ds-label="cvmTempStatusDescr" filterOperator="OR" ds-name="cvmTempStatusValue"/>
      <threshold description="Trigger an alert when the temperature metric on a Cisco device increases by 20% in one measurement interval" type="relativeChange" ds-type="ciscoEnvMonTemperatureStatusIndex" value="0.2" rearm="0.0" trigger="1" ds-label="cvmTempStatusDescr" filterOperator="OR" ds-name="cvmTempStatusValue"/>
   </group>
   <group name="juniper-srx" rrdRepository="/var/lib/opennms/rrd/snmp/">
      <expression description="Trigger an alert when the number of tracked sessions of a Juniper SRX router exceeds 90% of its capacity for two consecutive measurement intervals" type="high" ds-type="node" value="90.0" rearm="75.0" trigger="2" filterOperator="OR" expression="juniSPUMonCurrFlow / juniSPUMonMaxFlow * 100.0"/>
   </group>
   <group name="netsnmp" rrdRepository="/var/lib/opennms/rrd/snmp/">
      <threshold description="Trigger an alert when the percentage of disk space used on any disk reaches or goes above 90% full for two consecutive measurement intervals" type="high" ds-type="dskIndex" value="90.0" rearm="85.0" trigger="2" ds-label="ns-dskPath" triggeredUEI="uei.opennms.org/threshold/highThresholdExceeded" rearmedUEI="uei.opennms.org/threshold/highThresholdRearmed" filterOperator="OR" ds-name="ns-dskPercent"/>
      <threshold description="Trigger an alert when the percentage of inodes used on any disk (excluding the specified special paths) reaches or goes above 90% for two consecutive measurement intervals" type="high" ds-type="dskIndex" value="90.0" rearm="85.0" trigger="2" ds-label="ns-dskPath" triggeredUEI="uei.opennms.org/threshold/highThresholdExceeded" rearmedUEI="uei.opennms.org/threshold/highThresholdRearmed" filterOperator="AND" ds-name="ns-dskPercentNode">
         <resource-filter field="ns-dskPath">^(?:(?!(/proc|/sys|/dev/pts)).)+$</resource-filter>
      </threshold>
      <threshold description="Trigger an alert when the percentage of disk space used on any disk increases by a relative 33.3% compared to its most recent previous measurement (that is, there is suddenly less free space)" type="relativeChange" ds-type="dskIndex" value="1.333" rearm="0.0" trigger="1" ds-label="ns-dskPath" filterOperator="OR" ds-name="ns-dskPercent"/>
      <threshold description="Trigger an alert when the percentage of inodes used on any disk increases by a relative 33.3% compared to its most recent previous measurement (that is, there are suddenly fewer free inodes)" type="relativeChange" ds-type="dskIndex" value="1.333" rearm="0.0" trigger="1" ds-label="ns-dskPath" filterOperator="OR" ds-name="ns-dskPercentNode"/>
      <expression description="Trigger an alert when the five minute CPU load average metric reaches or goes above 10 for two consecutive measurement intervals" type="high" ds-type="node" value="10.0" rearm="7.5" trigger="2" filterOperator="OR" expression="loadavg5 / 100.0"/>
      <expression description="Trigger an alert when the amount of available swap space reaches or goes below 10% of the total amount of swap space for two consecutive measurement intervals (only for systems that have a total swap space value defined)" type="low" ds-type="node" value="10.0" rearm="15.0" trigger="2" filterOperator="OR" expression="memAvailSwap / memTotalSwap * 100.0">
         <resource-filter field="memTotalSwap">^[1-9]+[.0-9]*$</resource-filter>
      </expression>
   </group>
   <group name="netsnmp-memory-linux" rrdRepository="/var/lib/opennms/rrd/snmp/">
      <expression description="Trigger an alert when the sum of the amount of unused real/physical memory plus the amount of real/virtual memory currently allocated as cached memory expressed as a percentage of total system memory reaches or goes below 5% for two consecutive measurement intervals" type="low" ds-type="node" value="5.0" rearm="10.0" trigger="2" filterOperator="OR" expression="(memAvailReal + memCached) / memTotalReal * 100.0"/>
   </group>
   <group name="netsnmp-memory-nonlinux" rrdRepository="/var/lib/opennms/rrd/snmp/">
      <threshold description="Trigger an alert when the percentage of disk space" type="high" ds-type="dskIndex" value="90.0" rearm="85.0" trigger="2" ds-label=" ns-dskPath" triggeredUEI="uei.opennms.org/threshold/highThresholdExceeded" rearmedUEI="uei.opennms.org/threshold/highThresholdRearmed" filterOperator="OR" ds-name="ns-dskPercent"/>
      <threshold description="Trigger an alert when the percentage of inodes used on any disk (excluding the specified special paths) reaches or goes above 90% for two consecutive measurement intervals" type="high" ds-type="dskIndex" value="90.0" rearm="85.0" trigger="2" ds-label="ns-dskPath" triggeredUEI="uei.opennms.org/threshold/highThresholdExceeded" rearmedUEI="uei.opennms.org/threshold/highThresholdRearmed" filterOperator="OR" ds-name="ns-dskPercentNode">
         <resource-filter field="ns-dskPath">^(?:(?!(/proc|/sys|/dev/pts)).)+$</resource-filter>
      </threshold>
      <expression description="Trigger an alert when the amount of unused real/physical memory expressed as a percentage of total system memory reaches or goes below 5% for two consecutive measurement intervals" type="low" ds-type="node" value="5.0" rearm="10.0" trigger="2" filterOperator="OR" expression="memAvailReal / memTotalReal * 100.0"/>
   </group>
   <group name="coffee" rrdRepository="/var/lib/opennms/rrd/snmp/">
      <expression description="Trigger an alert when the coffee pot level reaches or goes below 25% in one measurement interval" type="low" ds-type="node" value="25.0" rearm="100.0" trigger="1" filterOperator="OR" expression="coffeePotLevel / coffeePotCapacity * 100.0"/>
   </group>
   <group name="BSNMP" rrdRepository="/var/lib/opennms/rrd/snmp/">
      <threshold description="Trigger an alert when the percentage of disk space" type="high" ds-type="hrStorageFBSD" value="90.0" rearm="85.0" trigger="2" ds-label=" ns-dskPath" triggeredUEI="uei.opennms.org/threshold/highThresholdExceeded" rearmedUEI="uei.opennms.org/threshold/highThresholdRearmed" filterOperator="OR" ds-name="ns-dskPercent"/>
      <threshold description="Trigger an alert when the percentage of inodes used on any disk (excluding the specified special paths) reaches or goes above 90% for two consecutive measurement intervals" type="high" ds-type="hrStorageFBSD" value="90.0" rearm="85.0" trigger="2" ds-label="ns-dskPath" triggeredUEI="uei.opennms.org/threshold/highThresholdExceeded" rearmedUEI="uei.opennms.org/threshold/highThresholdRearmed" filterOperator="OR" ds-name="ns-dskPercentNode">
         <resource-filter field="ns-dskPath">^(?:(?!(/proc|/sys|/dev/pts)).)+$</resource-filter>
      </threshold>
      <expression description="Trigger an alert when the amount of unused real/physical memory expressed as a percentage of total system memory reaches or goes below 5% for two consecutive measurement intervals" type="low" ds-type="node" value="5.0" rearm="10.0" trigger="2" filterOperator="OR" expression="memAvailReal / memTotalReal * 100.0"/>
   </group>
</thresholding-config>