Sponsored Content
Full Discussion: What does -H -v 1 -C -c -w3$
Top Forums Shell Programming and Scripting What does -H -v 1 -C -c -w3$ Post 302659921 by waelkd on Thursday 21st of June 2012 03:20:26 PM
Old 06-21-2012
Quote:
Originally Posted by jim mcnamara
We cannot know without seeing what the script's code does with parameters.
this is the code , i guess after reading whats inside print where every letter is declared i understand what everyone of these letters do.

EDIT: if only i have scratched my head harder lol

Quote:
undef($result);

$cpu /= $i;

# Plugin return code
my $status = "OK";
if ($cpu >= $opt_c) {
$status = "CRITICAL";
} elsif ($cpu >= $opt_w) {
$status = "WARNING";
}

my $str = "CPU utilization percentage : ".$cpu."%|avg=".$cpu."%";
if ($opt_l == 0) {
for ($i = 0; defined($cpulist[$i]); $i++){
$str .= " cpu$i=".$cpulist[$i]."%";
}
}

# Display Ouptut
print $str."\n";
undef($str);
exit $ERRORS{$status};

sub print_usage () {
print "\nUsage:\n";
print "$PROGNAME\n";
print "This Plugin is design for return CPU percent on windows Serveurs (1 min Average)\n";
print "\n";
print " -H (--hostname) Hostname to query - (required)\n";
print " -C (--community) SNMP read community (defaults to public,\n";
print " -c (--critical) Three critical tresholds (defaults : 95)\n";
print " -w (--warning) Three warning tresholds (defaults : 90)\n";
print " -l Display only cpu average\n";
print " -v (--snmp_version) 1 for SNMP v1 (default)\n";
print " 2 for SNMP v2c\n";
print " -k (--key) snmp V3 key\n";
print " -p (--password) snmp V3 password\n";
print " -u (--username) snmp v3 username \n";
print " -V (--version) Plugin version\n";
print " -h (--help) usage help\n";
}



sub print_help () {
print
print_usage();
print "\n";
}
 
procsystime(1m) 						   USER COMMANDS						   procsystime(1m)

NAME
procsystime - analyse system call times. Uses DTrace. SYNOPSIS
procsystime [-acehoT] [ -p PID | -n name | command ] DESCRIPTION
procsystime prints details on system call times for processes, both the elapsed times and on-cpu times can be printed. The elapsed times are interesting, to help identify syscalls that take some time to complete (during which the process may have slept). CPU time helps us identify syscalls that are consuming CPU cycles to run. Since this uses DTrace, only users with root privileges can run this command. OPTIONS
-a print all data -c print syscall counts -e print elapsed times, ns -o print CPU times, ns -T print totals -p PID examine this PID -n name examine processes which have this name EXAMPLES
Print elapsed times for PID 1871, # procsystime -p 1871 Print elapsed times for processes called "tar", # procsystime -n tar Print CPU times for "tar" processes, # procsystime -on tar Print syscall counts for "tar" processes, # procsystime -cn tar Print elapsed and CPU times for "tar" processes, # procsystime -eon tar print all details for "bash" processes, # procsystime -aTn bash run and print details for "df -h", # procsystime df -h FIELDS
SYSCALL System call name TIME (ns) Total time, nanoseconds COUNT Number of occurrences DOCUMENTATION
See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with ver- bose descriptions explaining the output. EXIT
procsystime will sample until Ctrl-C is hit. AUTHOR
Brendan Gregg [Sydney, Australia] SEE ALSO
dtruss(1M), dtrace(1M), truss(1) version 1.00 Sep 22, 2005 procsystime(1m)
All times are GMT -4. The time now is 08:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy