Sponsored Content
Top Forums Shell Programming and Scripting Calculate disk usage in different servers Post 302191765 by fabtagon on Sunday 4th of May 2008 07:08:24 PM
Old 05-04-2008
short pseudo-code sketch:
Code:
for line in input_file
do
  server=split line ...
  dir = split line ...
  output=`ssh server du -m dir`
  usage=split output ...
  if [ usage > treshold]
  then
    do something
  fi
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to calculate Memory and CPU Usage on AIX

I have written a script that will calculate CPU usage and Memory usage of a particular process on AIX Unix. I know the PID and I am using the command -- # for CPU Usage MSG_CPU_USG=`ps uax | grep ${PID} | awk {'print $3'}` #for Memory Usage MSG_MEM_USG=`ps uax | grep ${PID} | awk {'print... (0 Replies)
Discussion started by: asutoshch
0 Replies

2. UNIX for Dummies Questions & Answers

Need to calculate sftp time beteen two servers.

Hi, I need to calculate time taken by a 100kb file for sftp between two servers. I am new to unix can some body please tell me how do this. Thanks in advance... Vivek (2 Replies)
Discussion started by: koulvivek
2 Replies

3. Solaris

current CPU usage, memory usage, disk I/O oid(snmp)

Hi, I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP. I want the oids for above tasks. can you please tell me that Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies

4. Shell Programming and Scripting

calculate usage from file

Hello folks, i have a file courierimapuiddb that have contents like 1 1280206508 4 1 1280206466.V805I169cM853838.xxx 2 1280207962.V805I16d5M343672.xxx 3 1280208055.V805I16d6M20816.xxx 1280206508 above means total size and its decreasing when file added in directory. when total... (8 Replies)
Discussion started by: learnbash
8 Replies

5. Shell Programming and Scripting

Grep string from logs of last 1 hour on files of 2 different servers and calculate count

Hi, I am trying to grep a particular string from the files of 2 different servers without copying and calculate the total count of its occurence on both files. File structure is same on both servers and for reference as follows: 27-Aug-2010... (4 Replies)
Discussion started by: poweroflinux
4 Replies

6. Shell Programming and Scripting

calculate swap space usage in Solaris and converts it in Percentage

Hi Folks, I am looking for a way to write a script to calculate swap usage in Solaris so that the current usage will be shown in Percentage value. Thanks!! Based on 'swap -s' command # swap -s total: 1378936k bytes allocated + 1236880k reserved = 2615816k used, 2725104k available (2 Replies)
Discussion started by: jaapar
2 Replies

7. Linux

How to Calculate Disk Queue length and Disk Busy Time

Hi, Am doing an enhancements related to monitoring a Linux disk I/O statistics. The /proc/diskstats file is used to get the each disk I/O statistics. But, It returns the raw value. How to calculate the Disk Queue Length and Disk Busy time from the raw values. Guide me. (1 Reply)
Discussion started by: maruthu
1 Replies

8. Linux

How to calculate total CPU usage from SAR report?

Hi, I want to calculate the total cpu usage from the sar report. Say for example, Linux 2.6.24-21-generic (blade10) 09/10/2012 04:54:36 PM CPU %user %nice %system %iowait %steal %idle 04:54:37 PM all 0.00 0.00 0.00 0.00 ... (1 Reply)
Discussion started by: rohitmd
1 Replies

9. UNIX for Beginners Questions & Answers

Disk usage monitoring and record the disk used in last 24 hour

HI I am Trying to edit the below code to send email every day with difference of disk utilized in for last 24 hours but instead getting same usage everyday. can you please help me to point out where my calculation is going wrong. Thank you. ================= #!/bin/bash TODAY="at $(date... (0 Replies)
Discussion started by: Mi4304
0 Replies

10. Solaris

How to calculate total number of cores on my servers ?

Hi, I want to get total number of cores on my all non-global zones on Solaris 10. I got two methods and both are giving different results. Below link is a script, which tells me that total cores are 8 Mandalika's scratchpad: Oracle Solaris: Show Me the CPU, vCPU, Core Counts and the... (4 Replies)
Discussion started by: ron323232
4 Replies
unshar(1)							   User Commands							 unshar(1)

NAME
unshar - unpack a shar archive SYNOPSIS
unshar [-flag [value]]... [--opt-name[[=| ]value]]... [ file ... ] DESCRIPTION
Unshar scans the input files (typically email messages) looking for the start of a shell archive. If no files are given, then standard input is processed instead. It then passes each archive discovered through an invocation of the shell program to unpack it. OPTIONS
-d dir, --directory=dir change directory to dir first. Before unpacking any files, change the current directory to dir. -c, --overwrite Overwrite any pre-existing files. This option is passed through as an option to the shar file. Many shell archive scripts accept a -c argument to indicate that existing files should be overwritten. -f, --force This is an alias for the --overwrite option. -E split-pat, --split-at=split-pat separate archives on split-pat lines. With this option, unshar isolates each different shell archive from the others which have been placed in the same file, unpacking each in turn, from the beginning of the file to the end. Its proper operation relies on the fact that many shar files are termi- nated by a readily identifiable string. For example, noticing that most `.signatures' have a double hyphen ("--") on a line right before them, one can then sometimes use --split-at=--. The signature will then be skipped, along with the headers of the following message. -e, --exit-0 split archives at "exit 0" lines. This option must not appear in combination with any of the following options: split-at. Most shell archives end with a line consisting of simply "exit 0". This option is equivalent to (and conflicts with) --split- at="exit 0". -h, --help Display usage information and exit. -!, --more-help Pass the extended usage information through a pager. -R [rcfile], --save-opts[=rcfile] Save the option state to rcfile. The default is the last configuration file listed in the OPTION PRESETS section, below. -r rcfile, --load-opts=rcfile, --no-load-opts Load options from rcfile. The no-load-opts form will disable the loading of earlier RC/INI files. --no-load-opts is handled early, out of order. -v [{v|c|n}], --version[={v|c|n}] Output version of program and exit. The default mode is `v', a simple version. The `c' mode will print copyright information and `n' will print the full copyright notice. OPTION PRESETS
Any option that is not marked as not presettable may be preset by loading values from configuration ("RC" or ".INI") file(s). The file "$HOME/.sharrc" will be used, if present. FILES
See OPTION PRESETS for configuration files. EXIT STATUS
One of the following exit values will be returned: 0 (EXIT_SUCCESS) Successful program execution. 1 (EXIT_FAILURE) The operation failed or the command syntax was not valid. 66 (EX_NOINPUT) A specified configuration file could not be loaded. 70 (EX_SOFTWARE) libopts had an internal operational error. Please report it to autogen-users@lists.sourceforge.net. Thank you. SEE ALSO
shar(1) AUTHORS
The shar and unshar programs is the collective work of many authors. Many people contributed by reporting problems, suggesting various improvements or submitting actual code. A list of these people is in the THANKS file in the sharutils distribution. COPYRIGHT
Copyright (C) 1994-2013 Free Software Foundation, Inc. all rights reserved. This program is released under the terms of the GNU General Public License, version 3 or later. BUGS
Please put sharutils in the subject line for emailed bug reports. It helps to spot the message. Please send bug reports to: bug-gnu-utils@gnu.org NOTES
This manual page was AutoGen-erated from the unshar option definitions. GNU sharutils (4.13.3) 06 Jan 2013 unshar(1)
All times are GMT -4. The time now is 01:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy