Bug 151995 - net-mgmt/nagios-plugins: new plugin to check CPU usage
Summary: net-mgmt/nagios-plugins: new plugin to check CPU usage
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Olli Hauer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-06 21:00 UTC by Marián Jamrich
Modified: 2010-12-03 22:04 UTC (History)
0 users

See Also:


Attachments
file.shar (3.15 KB, text/plain)
2010-11-06 21:00 UTC, Marián Jamrich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marián Jamrich 2010-11-06 21:00:16 UTC
Nagios Plugin to check your actually CPU utilization.

- Marián Jamrich
jamrich.majo@gmail.com

Fix: Patch attached with submission follows:
Comment 1 Olli Hauer freebsd_committer freebsd_triage 2010-11-22 21:57:07 UTC
State Changed
From-To: open->feedback

Hi Marian, 

can you try to include your script in a port? 
It should be not so hard to do this, you can use 
for example ports-mgmt/portlint as starting point. 

Additional some good documentation how to create and  
test a port can be found here: 
http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/
Comment 2 Olli Hauer freebsd_committer freebsd_triage 2010-11-23 23:13:34 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ohauer

Hi Marian, 

your first port Makefile was nearly perfect ;) 

If possible use next time tar instead of rar if you provide 
additional files. 

I've reworked the port to not download the script. The script 
can be delivered with the port since it is a small one. 

Do you really need values behind the "." or is a full 
integer OK? If so "vmstat -c 2 -n 0 | tail -n 1" or "uptime" 
is a way faster than "top -n -d 2 | awk ..." 

I've uploaded the rewritten port for your review, feel free 
to change the vmstat command back to top it is only a suggestion. 

http://people.freebsd.org/~ohauer/diffs/nagios-check_cpu_usage/
Comment 3 dfilter service freebsd_committer freebsd_triage 2010-12-03 21:52:54 UTC
ohauer      2010-12-03 21:52:49 UTC

  FreeBSD ports repository

  Modified files:
    net-mgmt             Makefile 
  Added files:
    net-mgmt/nagios-check_cpu_usage Makefile pkg-descr 
    net-mgmt/nagios-check_cpu_usage/src check_cpu_usage 
  Log:
  check_cpu_usage is a plugin intended for use with the Nagios network
  monitoring system.  This plugin checks the current CPU load and
  compares the current state to given thresholds, returning the result.
  It is written as shell script.
  
  PR:             ports/151995
  Submitted by:   jamrich.majo at gmail.com
  
  Revision  Changes    Path
  1.228     +1 -0      ports/net-mgmt/Makefile
  1.1       +26 -0     ports/net-mgmt/nagios-check_cpu_usage/Makefile (new)
  1.1       +4 -0      ports/net-mgmt/nagios-check_cpu_usage/pkg-descr (new)
  1.1       +120 -0    ports/net-mgmt/nagios-check_cpu_usage/src/check_cpu_usage (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 Olli Hauer freebsd_committer freebsd_triage 2010-12-03 22:03:35 UTC
State Changed
From-To: feedback->closed

Committed with minor changes (approved by submitter per mail). 
- add Makefile 
- use vmstat instead of top 
Thanks!