Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added "-c <cfgfile>" option

  • Loading branch information...
commit 09898e29693fcee11166c0033f178a50993104ae 1 parent 3f01bf6
gerir authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 bin/xnperfstat
View
11 bin/xnperfstat
@@ -1,8 +1,8 @@
#!/bin/bash
-# xnperfstat, v0.2
+# xnperfstat, v0.3
# gerir@ning.com
-# 2008.11.06
+# 2011.11.03
#
# a wrapper for NetApp's perfstat.
# =========================================================================================
@@ -18,7 +18,7 @@ export PATH=/bin:/usr/bin:/usr/sbin:/opt/csw/bin:/local/data/filer/bin
rotate='' # rotation?
unlock='' # unlock
- NAPERFSW_CONFIG="/local/data/filer/etc/xnperfstat.cfg"
+ NAPERFSW_CONFIG="/local/etc/xnperfstat/xnperfstat.cfg"
NAPERFSW_LOCK=""
PERFSTAT_DATADIR_BASE='/local/data/filer/data/perfstat'
@@ -117,7 +117,7 @@ export PATH=/bin:/usr/bin:/usr/sbin:/opt/csw/bin:/local/data/filer/bin
## process cli options and arguments
- OPTSTRING=":hm:dnrut:o:"
+ OPTSTRING=":hc:m:dnrut:o:"
OPTIND=1
while getopts "$OPTSTRING" opt; do
@@ -129,6 +129,9 @@ export PATH=/bin:/usr/bin:/usr/sbin:/opt/csw/bin:/local/data/filer/bin
case $opt in
'd') continue
;;
+ 'c') NAPERFSW_CONFIG="$OPTARG"
+ [ ! -r "$cfgfile" ] && perror fatal "unable to read configuration file $cfgfile" || continue
+ ;;
'n') nagios=1
[ "$dbg" ] && pdebug "nagios enabled."
;;
Please sign in to comment.
Something went wrong with that request. Please try again.