<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Nagios graph for CPU utilisation in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/nagios-graph-for-cpu-utilisation/m-p/6836451#M489311</link>
    <description>&lt;P&gt;Have asked this question in Nagios forums.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Feb 2016 08:07:26 GMT</pubDate>
    <dc:creator>chindi</dc:creator>
    <dc:date>2016-02-25T08:07:26Z</dc:date>
    <item>
      <title>Nagios graph for CPU utilisation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nagios-graph-for-cpu-utilisation/m-p/6821616#M489239</link>
      <description>&lt;P&gt;Hi, Am trying to configure nagios graphs for cpu utilisation , but when am trying below .pl file am getting only %usr calculation , as a result of which my main aim of using Nagios is gone for toss.&lt;/P&gt;&lt;P&gt;It must actually show usr+sys .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#!/usr/bin/perl&lt;/P&gt;&lt;P&gt;#**************************************************************&lt;BR /&gt;#Plugin Nagios chequear uso CPU&lt;BR /&gt;# Configurar el en nrpe de hp-ux&lt;BR /&gt;# Integracion en nrpe, en la seccion del archivo nrpe.cfg, "The following examples use hardcoded command arguments...", incluir la linea:&lt;BR /&gt;# command[check_hpux_cpu]=/opt/nrpe/libexec/check_hpux_cpu.pl -w 80 -c 90&lt;BR /&gt;# Realizador: Jaime Andres Cardona&lt;BR /&gt;# Correo: ja_an_ca@hotmail.com&lt;BR /&gt;# Version: 1.0&lt;BR /&gt;# Fecha: 2011-Oct-26&lt;/P&gt;&lt;P&gt;use Getopt::Long;&lt;BR /&gt;&amp;amp;Getopt::Long::config('auto_abbrev');&lt;/P&gt;&lt;P&gt;my $numbarg = @ARGV;&lt;BR /&gt;($numbarg &amp;lt; 2) &amp;amp;&amp;amp; &amp;amp;show_help;&lt;/P&gt;&lt;P&gt;my %STATUSCODE = ( 'UNKNOWN' =&amp;gt; '-1',&lt;BR /&gt;'OK' =&amp;gt; '0',&lt;BR /&gt;'WARNING' =&amp;gt; '1',&lt;BR /&gt;'CRITICAL' =&amp;gt; '2');&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;sub show_help {&lt;BR /&gt;printf("usage: ./check_hpux_cpu.pl -w # -c #\n&lt;BR /&gt;options:&lt;BR /&gt;-w warning threshold (%)&lt;BR /&gt;-c critical threshold (%)&lt;/P&gt;&lt;P&gt;");&lt;BR /&gt;exit($STATUSCODE{"UNKNOWN"});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$status = GetOptions( "warn=s", \$warn,&lt;BR /&gt;"crit=i", \$crit);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;open(PS, "/usr/bin/vmstat 1 4 | egrep -v '[a-z,A-Z]|-' |egrep '[0-9]' |") || return 1;&lt;BR /&gt;while (&amp;lt;PS&amp;gt;) {&lt;BR /&gt;(undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,$idle,undef) = split(/[\t \n]+/);&lt;BR /&gt;$tidle = $tidle + $idle;&lt;BR /&gt;}&lt;BR /&gt;$usage = $tidle / 4;&lt;/P&gt;&lt;P&gt;if ($usage &amp;gt;= $crit) {&lt;/P&gt;&lt;P&gt;printf("CRITICAL - CPU usage at $usage% | 'CPU Load'=$usage%;$warn;$crit;0;100\n");&lt;BR /&gt;exit($STATUSCODE{"CRITICAL"});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;elsif ($usage &amp;gt;= $warn) {&lt;/P&gt;&lt;P&gt;printf("WARNING - CPU usage at $usage% | 'CPU Load'=$usage%;$warn;$crit;0;100\n");&lt;BR /&gt;exit($STATUSCODE{"WARNING"});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;elsif ($usage &amp;lt; $warn) {&lt;/P&gt;&lt;P&gt;printf("OK - CPU usage at $usage% | 'CPU Load'=$usage%;$warn;$crit;0;100\n");&lt;BR /&gt;exit($STATUSCODE{"OK"});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;else {&lt;BR /&gt;printf("UNKNOWN - unable to determin usage\n");&lt;BR /&gt;exit($STATUSCODE{"UNKNOWN"});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;=================================================================&lt;/P&gt;&lt;P&gt;root #/opt/iexpress/nagios/libexec &amp;gt;vmstat 1 4&lt;BR /&gt;procs memory page faults cpu&lt;BR /&gt;r b w avm free re at pi po fr de sr in sy cs us sy id&lt;BR /&gt;5 6 0 23693444 24475061 0 0 9 0 0 0 0 23909 1509482 63321 15 10 74&lt;BR /&gt;5 6 0 23693444 24699477 0 0 1 0 0 0 0 21800 779633 13934 14 12 75&lt;BR /&gt;5 6 0 23693444 24781023 0 0 1 0 0 0 0 21439 762179 15067 10 8 82&lt;BR /&gt;5 6 0 23693444 24478642 0 0 1 0 0 0 0 21385 829326 16418 15 15 70&lt;/P&gt;&lt;P&gt;root #/opt/iexpress/nagios/libexec &amp;gt;/opt/iexpress/nagios/libexec/check_hpux_cpu.pl -w 80 -c 90&lt;BR /&gt;OK - CPU usage at 11.25% | 'CPU Load'=11.25%;80;90;0;100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 11:18:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nagios-graph-for-cpu-utilisation/m-p/6821616#M489239</guid>
      <dc:creator>chindi</dc:creator>
      <dc:date>2016-01-04T11:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Nagios graph for CPU utilisation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nagios-graph-for-cpu-utilisation/m-p/6836451#M489311</link>
      <description>&lt;P&gt;Have asked this question in Nagios forums.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 08:07:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nagios-graph-for-cpu-utilisation/m-p/6836451#M489311</guid>
      <dc:creator>chindi</dc:creator>
      <dc:date>2016-02-25T08:07:26Z</dc:date>
    </item>
  </channel>
</rss>

