Sponsored Content
Full Discussion: Debugging Help needed
Top Forums UNIX for Beginners Questions & Answers Debugging Help needed Post 303013657 by doghouse308 on Sunday 25th of February 2018 12:04:09 PM
Old 02-25-2018
Debugging Help needed

I am VERY much a neophyte with shell scripting. I am working on the following,

"Create a script sends an email message to the user specified on the command line if any of the file
systems at more than 60% of capacity. The script should not process special file systems as /proc on
the ce.uml.edu. It should only process file systems which are either locally mounted or are mounted
via NFS."

This is my starting point:

Code:
#!/bin/bash
#  script to send an email message to the user specified on the command line if
# any of the file systems at more than 60% of capacity.

df -H | grep -vE '^Filesystem' | 'none' | awk '{ print $1 " " $5 }' | while read fsout
do
  echo "$fsout"
  partition=$(echo "$fsout" | awk '{ print $2 }' )
  usage=$(echo "$fsout" | awk '{ print $1 }' | cut -d'%' -f1)

  if [ $usage -ge 90 ]
  then
    echo "CRITICAL WARNING!!: Filesystem \"$partition\" at "$usage"% of capacity" |
    mail -s "CRITICAL WARNING!!: Filesystem \"$partition\" at "$usage"% of capacity" paul_peterson@student.uml.edu

  elif [ $usage -ge 60 ] && [ $usage -lt 90 ]
  then
    echo "Warning!!: Filesystem \"$partition\" at "$usage"% of capacity" |
    mail -s "Warning!!: Filesystem \"$partition\" at "$usage"% of capacity" paul_peterson@student.uml.edu
  fi
done

I ma getting these errors:

Code:
./fsc.sh: line 4: $'\r': command not found
./fsc.sh: line 16: syntax error near unexpected token `elif'
'/fsc.sh: line 16: `  elif [ $usage -ge 60 ] && [ $usage -lt 90 ]

Any help is greatly appreciated.


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 02-25-2018 at 01:17 PM.. Reason: Added CODE tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Regarding Debugging

Hi, If we want to debug a shell script, then set -vx has to be included in the begining of the script. Just i want to know what purpose -vx is used. Thanks in advace Sarwan (2 Replies)
Discussion started by: sarwan
2 Replies

2. Programming

function debugging. help

Hi, I tried creating my version of the cat function in bash but left it and now I'm trying to make this function work, but it wouldn't. #include <sys/param.h> #include <sys/stat.h> #include <locale.h> #include <ctype.h> #include <err.h> #include <errno.h> #include <fcntl.h>... (2 Replies)
Discussion started by: sanchopansa
2 Replies

3. Programming

Semaphore debugging

I'm running one multithreaded application, in that one of my thread is waiting infinitely in a semphore. Is there a way to determine, in which semaphore the particular thread is waiting and which thread(s) is holding the semaphore. (5 Replies)
Discussion started by: ptprabu
5 Replies

4. Shell Programming and Scripting

debugging in bash!!! help needed

Hi all, Am using bash shell. Am newbie, trying to understand the debugin process of a shell script... I am unable to comprehend the control flow ,meaning from where exactly the execution of the script begins... I tried using bash-xv <scriptname> but since am new ,am finding it difficult to... (2 Replies)
Discussion started by: wrapster
2 Replies

5. Solaris

debugging

when I tried to debug my application i got the following. gdb -v GNU gdb 6.6 file is in C and Xmotiff Languages (gdb) attach 25499 Attaching to process 25499 Retry #1: Retry #2: Retry #3: Retry #4: 0xfea40b68 in ?? () (gdb) where #0 0xfea40b68 in ?? () (0 Replies)
Discussion started by: satish@123
0 Replies

6. Programming

Need some help in debugging the C-Progam.

Hi i want to debug the C program with GDB debugger. I want to debug the program by line by line. I want to debug program like as we debug the program in Turbo-C using the F8. Can any one help me? I know i have to use single stepping. But i don't know how to use it. Any help can be appreciated..... (5 Replies)
Discussion started by: ps_sach
5 Replies

7. Shell Programming and Scripting

script debugging

is there any way you can add a breakpoint in a script so you can stop on it? i have used -xv in my shebang but the script just runs and i want it to stop at a specific point in the script. appreciate any help. (1 Reply)
Discussion started by: npatwardhan
1 Replies

8. Programming

c++ debugging

hey i have a problem with a switch case in program and the debugger is messy has hell ( we use normal VI and gdb in our schoool to make it more diffiacult) any way i have a problom where for some unknown reason the debugger just skips a switch statment as if it wasent even there the rest... (2 Replies)
Discussion started by: gotenxds
2 Replies

9. Shell Programming and Scripting

Debugging functions

So here I have a simple function that I wish to debug. However, I am unable to debug the desired function even with set -o functrace enabled. Before resorting to asking this question, I had managed to find a possible solution that did not produce the desired results, which is located here. How... (5 Replies)
Discussion started by: BrandonD
5 Replies

10. Homework & Coursework Questions

Debugging Help Needed

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! I am VERY much a neophyte with shell scripting. I am working on the following, 1. The problem statement, all variables and given/known data: "Create a script sends an... (7 Replies)
Discussion started by: doghouse308
7 Replies
icapstatus(1M)															    icapstatus(1M)

NAME
icapstatus - Display Instant Capacity (iCAP) status and system information. SYNOPSIS
icapstatus icapstatus -s Deprecated: icod_stat icod_stat -s DESCRIPTION
The command displays Instant Capacity status and configuration information, counts, status, and allocation of Instant Capacity components (cores, memory, and cells) for an Instant Capacity system. If the system is a member of a Global Instant Capacity (GiCAP) group, member- ship information and status on any borrowed or loaned usage rights is displayed. Optionally, system snapshot information containing encrypted audit data is displayed. The deprecated command performs the identical functions and is maintained for backward compatibility. For further information see the located at /usr/share/doc/icapUserGuide.pdf. Symbols used in the display uses symbols next to the value of some fields in certain circumstances. These symbols are: * Indicates an estimated number of active cores or active memory. For more information on what these estimates might be, see the located at /usr/share/doc/icapUserGuide.pdf. # Indicates that all cores in the partition have been requested to be active. The number indicates the current number of cores in the partition. icapstatus display fields If no options are specified, displays: Software Version: This field displays the version of the Instant Capacity client software on the local system. System ID: This field displays the user-specified system identifier that the Instant Capacity system uses when reporting the system state to HP, and when HP refers to this system in correspondence to the system contact. The default value for this field is the hostname of the Instant Capacity system. To change this value, use the command (see icapmodify(1M)). Serial number: This field displays the hardware serial number of the Instant Capacity complex. Product number: This field displays the hardware product number of the Instant Capacity complex. Unique ID: This field displays a unique identifier for the Instant Capacity complex (generated by HP). System contact email: This field displays the email address for the person who should receive configuration change notification and exception reports for the local system. This field is set via the command. From email: This field displays the email address that will be specified as the sender of all Instant Capacity initiated email corre- spondence for the local system. This field is set via the command. If not set, email will be sent from the adm user on the local system. Asset reporting: This field indicates if the Instant Capacity software on the local system is presently configured to send email asset reports to HP. This is configured using the command. Temporary capacity warning period: This field displays the number of days constituting the temporary capacity warning period for the complex. When the tem- porary capacity balance is projected to be depleted within this number of days, a warning message is sent by email to the system contact and to root. The value of the warning period can be set using the command. Exception Status: This field indicates if the complex is presently in an exception state. A complex is usually in an exception state when the number of active components of a given type (cores, cells, memory) exceeds the number of available usage rights for that component type. The one exception is that the number of active cores is allowed to exceed the number of core usage rights as long as there is a sufficient positive balance of temporary capacity. A negative temporary capacity balance is always an exception state. Information displayed for a GiCAP group The following status information is displayed when the system is a member of a GiCAP group. Member <mname> in GiCAP group <gname> This section heading identifies the member name (<mname>) and the name of the GiCAP group (<gname>) that includes this system as a member. Active Group Manager: This field identifies the name of the active Group Manager system where you can get more detailed information about the group, by invoking the command (see icapmanage(1M)). Standby Group Manager: This field identifies the name of the standby Group Manager system, if a standby has been defined for the group. The standby Group Manager has the ability to take control of the group if the active Group Manager should become unavailable for any reason. The field is displayed as "N/A" if no standby Group Manager has been defined for the group. Borrowed/Loaned core usage rights: This field identifies the count of core usage rights that were either borrowed from or loaned to the GiCAP group. This value must be 0 in order to remove the member from the GiCAP group. Borrowed/Loaned cell usage rights: This field identifies the count of cell board usage rights that were either borrowed from or loaned to the GiCAP group. This value must be 0 in order to remove the member from the GiCAP group. Borrowed/Loaned memory usage rights: This field identifies the count of memory usage rights that were either borrowed from or loaned to the GiCAP group. This value must be 0 in order to remove the member from the GiCAP group. The output of reflects the results of any GiCAP group operations: the borrowing or loaning of component usage rights or the transfer of temporary capacity. The output does not take into account any component usage rights or temporary capacity that is available on other GiCAP group members. Thus, on group member A may report that there are no additional cores that may be activated with current usage rights even though there is an inactive core on group member A and an available core usage right on group member B. Use the command on the Group Manager system to get more complete information about available group resources. When a group member is using temporary capacity and core usage rights are made available on another group member through the use of , there may be a delay between the time the core usage rights are made available and the time the core usage rights move to the group member using temporary capacity. This also means that there may be a delay before the final result is reflected in the output of for each group member involved in the transfer of the core usage rights. Information displayed for the local virtual partition The following status is displayed when is run on a virtual partition. Note that some of the displayed information pertains specifically and only to the local virtual partition (such as the "number of active assigned cores" or "number of inactive assigned cores"). However, because usage rights and temporary capacity are always calculated globally across the entire complex, other local values involving these items (such as the "can be assigned" or "could be assigned" values) are the result of calculations using count values across all the parti- tions. Total number of assigned cores: This field displays the total number of cores assigned to the local virtual partition. Number of active assigned cores: This field displays the number of assigned cores in the local virtual partition that are currently active. Number of inactive assigned cores: This field displays the number of assigned cores in the local virtual partition that are currently inactive. Additional cores that can be assigned with current usage rights: This field displays the number of unassigned cores in the hard partition that are not currently assigned to any virtual partition and can be instantly assigned, because enough usage rights are available. Number of cores that could be assigned with additional usage rights: This field displays the number of cores that are available for assignment to the virtual partition if additional usage rights are purchased, or additional usage rights were borrowed from a GiCAP group. Number of cores that can be assigned with temporary capacity: This field displays the number of additional cores (beyond the number allowed by purchased usage rights or currently bor- rowed GiCAP usage rights) that can be assigned to the virtual partition and activated using temporary capacity currently available on the complex. When assigning and activating a core using temporary capacity, assumes the core is active for at least 30 minutes. Thus, if a complex has a small temporary capacity balance, it may not be possible to activate all the inactive cores in a partition using temporary capacity. Also, temporary capacity is not used as long as there are available core usage rights on the complex (or in the group, if a member of a GiCAP group), even if the -t option is used with for an activation. Number of cores currently unavailable for assignment: This field displays the number of unassigned cores in the hard partition that are not assigned to the local virtual parti- tion and cannot be instantly assigned. This number includes cores in inactive cells and deconfigured cores. If the local virtual partition is static the number includes all unassigned cores in the hard partition. Information displayed for the local nPartition In addition to displaying the current date and time as part of the heading, the following status is displayed when is run on a hard parti- tion. Much of this information is also displayed when is run on a virtual partition, except as otherwise specified. Note that some of the displayed information pertains specifically and only to the local hard partition (such as the "number of active cores" or "number of inac- tive cores"). However, because usage rights and temporary capacity are always calculated globally across the entire complex, other local values involving these items (such as "can be activated" or "could be activated" values) are the result of calculations using count values across all the partitions. The heading for this section includes a datestamp showing the date and time the command was issued. Total number of configured cores: This field displays the number of cores physically present in the hard partition. Number of intended active cores: This field displays the number of cores requested to be active for this hard partition; this is the number of cores that are activated during a boot operation. Typically, this is the number that results from the execution of an command. Other commands such as and can also affect this value. does not affect this value. Number of active cores: This field displays the current number of cores active in the hard partition. Number of inactive cores: This field displays the current number of inactive cores in the hard partition. Additional cores that can be activated with current usage rights: This field displays the number of cores that are immediately available for activation using existing core usage rights on the complex. This information is not displayed on a virtual partition. Number of cores that could be activated with additional usage rights: This field displays the number of cores that are available for activation if additional core usage rights were purchased or additional usage rights were borrowed from a GiCAP group. These cores are also available for temporary activation if temporary capacity is available. This information is not displayed on a virtual partition. Number of cores that can be activated with temporary capacity: This field displays the number of additional cores (beyond the number allowed by the purchased usage rights or currently borrowed GiCAP usage rights) that can be activated using temporary capacity currently available on the complex. When activating a core using temporary capacity, assumes the core is active for at least 30 minutes. Thus, if a complex has a small temporary capacity balance, it may not be possible to activate all the inactive cores in a partition using temporary capacity. Also, temporary capacity is not used as long as there are available core usage rights on the complex, even if the -t option is used with for an activation. This information is not displayed on a virtual partition. Number of cores that are deconfigured or attached to inactive cells: This field displays the number of cores that cannot be activated by Instant Capacity software. This includes cores in inactive cells, deconfigured cores, and failed cores deactivated because of LPMCs (Low Priority Machine Checks). This information is not displayed on a virtual partition. Instant Capacity Resource Summary The following status is displayed for the entire complex: Number of cells without usage rights: This field displays the number of configured cells in excess of the number of cell usage rights applied to the complex (purchased rights or borrowed from a GiCAP group). Therefore, this number represents the count of cells which are expected to be inactive. Number of inactive cells: This field displays the current number of inactive cells in the complex. Amount of memory without usage rights: This field displays the total amount of configured memory in excess of the amount of memory usage rights applied to the complex (purchased rights or borrowed from a GiCAP group). This amount of memory is expected to be inactive. Amount of inactive memory: This field displays the current amount of inactive memory in the complex. Number of cores without usage rights: This field displays the number of configured cores in excess of the number of core usage rights applied to the complex (purchased rights or borrowed from a GiCAP group). This is the number of cores that are expected to be inactive. (If fewer cores are inactive than are expected to be inactive, the complex is either consuming temporary capacity or is out of compliance.) Number of inactive cores: This field displays the current number of inactive cores in the complex. Number of cores using temporary capacity: This field displays the number of cores presently consuming temporary capacity in the complex. Number of cores that must be deactivated (insufficient usage rights): This field displays the number of active cores in excess of the number of available usage rights on the complex. For the system to be in compliance, this number of cores must be deactivated. Temporary capacity available: This field displays the amount of temporary capacity available. This balance is displayed in days, hours, and minutes. This value does not reflect any possible use of pooled temporary capacity from a GiCAP group, if the system is a member of a group. Projected temporary capacity expiration: This field displays the date and time that temporary capacity is projected to expire at the present consumption rate. This value does not reflect any possible use of pooled temporary capacity from a GiCAP group, if the system is a member of a group. Allocation of Instant Capacity Resources Among the nPartitions The following table displays how Instant Capacity components are distributed among the partitions in the complex: nPar ID: This field displays the partition number for the row of data. Total cores: This field displays the total number of cores physically present for the hard partition. Intended active cores: This field displays the number of cores requested to be active for this hard partition; this is the number of cores that will be activated during a boot operation. Typically, this is the number that results from the execution of an command. Other commands such as and can also affect this value. does not affect this value. Actual active cores: This field displays the current number of active cores for the hard partition. In a virtual partition, the count repre- sents the total number of cores assigned to all the virtual partitions. Inactive cores: This field displays the current number of inactive cores in the hard partition. In a virtual partition, the count repre- sents the total number of cores not assigned to any virtual partition. Inactive memory: This field displays the current amount of inactive memory in the hard partition. Inactive cells: This field displays the current number of inactive cells in the hard partition. Runs iCAP: This field indicates whether the hard partition contains compatible Instant Capacity software. nPar name: This field displays the partition name corresponding to the row of information that is displayed. If the row is the local partition, the word "local" follows the partition name. For cells that are not assigned to partitions, the "Unassigned Cells" label is displayed. Options recognizes these options: -s Displays system snapshot information. This option displays the product and serial number for this system, as well as a snapshot string that can be entered into the HP Utility Pricing Solutions portal for periodic auditing purposes. EXTERNAL INFLUENCES
Environment Variables o LANG determines the locale to use for the locale categories when both LC_ALL and the corresponding environment variable (begin- ning with LC_) do not specify a locale. If LANG is not set or is set to the empty string, a default of C is used (see lang(5)). o LC_TIME determines the date and time strings output. o LC_MESSAGES determines the language in which messages (other than the date and time strings) are displayed. If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to C (see envi- ron(5)). RETURN VALUE
The command exits with one of these values: 0 Command succeeded. 2 Command succeeded; system is not an Instant Capacity system. >0,!=2 Command failed; error message sent to STDERR. AUTHOR
was developed by HP. SEE ALSO
icapmodify(1M), icapnotify(1M), icapmanage(1M), icapd(1M), icap(5). icapstatus(1M)
All times are GMT -4. The time now is 03:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy