Sponsored Content
Top Forums Shell Programming and Scripting Help with Shell script that monitors CPU Usage Post 303028223 by jgt on Wednesday 2nd of January 2019 09:20:00 AM
Old 01-02-2019
Remove the quotation marks in the if statement
 

10 More Discussions You Might Find Interesting

1. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

2. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

3. Shell Programming and Scripting

Help with bash script - Need to get CPU usage as a percentage

I'm writing a bash script to log some selections from a sensors output (core temp, mb temp, etc.) and I would also like to have the current cpu usage as a percentage. I have no idea how to go about getting it in a form that a bash script can use. For example, I would simply look in the output of... (3 Replies)
Discussion started by: graysky
3 Replies

4. Shell Programming and Scripting

shell script to alert cpu memory and disk usage help please

Hi all can any one help me to script monitoring CPU load avg when reaches threshold value and disk usage if it exceeds some % tried using awk but when df -h out put is in two different lines awk doesnt work for the particular output in two different line ( output for df -h is in two... (7 Replies)
Discussion started by: robo
7 Replies

5. HP-UX

Perl script limit cpu usage

Hi Experts, I am executing multiple instances(in parallel) of perl script on HP-UX box. OS is allocating substantial amount of CPU to these perl processes,resulting higher cpu utilization. Glance always shows perl processes are occupying majority of the CPU resource. It is causing slower... (2 Replies)
Discussion started by: sai_2507
2 Replies

6. Shell Programming and Scripting

Shell script for logging cpu and memory usage of a Linux process

I am looking for a way to log and graphically display cpu and RAM usage of linux processes over time. Since I couldn't find a simple tool to so (I tried zabbix and munin but installation failed) I started writing a shell script to do so The script file parses the output of top command through... (2 Replies)
Discussion started by: andy_dufresne
2 Replies

7. Shell Programming and Scripting

Shell script to calculate the max cpu usage from the main script

Hi All, I have a script which does report the cpu usuage, there are few output parameter/fields displayed from the script. My problem is I have monitor the output and decide which cpu number (column 2) has maximum value (column 6). Since the output is displayed/updated every seconds, it's very... (1 Reply)
Discussion started by: Optimus81
1 Replies

8. Shell Programming and Scripting

CPU usage script

Hello Friends, I am trying to create a shell script which will check the CPU utilization. I use command top to check the %CPU usage. It give s me below output Cpu states: CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS 0 0.31 9.6% 0.0% 6.1% 84.3% 0.0% 0.0%... (3 Replies)
Discussion started by: Nakul_sh
3 Replies

9. Shell Programming and Scripting

Script for CPU usage -Linux

Hi all I was wondering if its possible to write a script to keep CPU usage at 90%-95%? for a single cpu linux server? I have a perl script I run on servers with multple cpu's and all I do is max all but one cpu to get into the 90'% utilised area. I now need a script that raises the CPU to... (4 Replies)
Discussion started by: sudobash
4 Replies

10. Shell Programming and Scripting

Help with speeding up my working script to take less time - how to use more CPU usage for a script

Hello experts, we have input files with 700K lines each (one generated for every hour). and we need to convert them as below and move them to another directory once. Sample INPUT:- # cat test1 1559205600000,8474,NormalizedPortInfo,PctDiscards,0.0,Interface,BG-CTA-AX1.test.com,Vl111... (7 Replies)
Discussion started by: prvnrk
7 Replies
PGDBF(1)						      General Commands Manual							  PGDBF(1)

NAME
pgdbf - convert XBase / FoxPro tables to PostgreSQL SYNOPSIS
pgdbf [-cCdDeEhqQtTuU] [-m memofile] filename [indexcolumn ...] DESCRIPTION
PgDBF is a program for converting XBase databases - particularly FoxPro tables with memo files - into a format that PostgreSQL can directly import. It's a compact C project with no dependencies other than standard Unix libraries. While the project is relatively tiny and sim- ple, it's also heavily optimized via profiling - routine benchmark were many times faster than with other Open Source programs. In fact, even on slower systems, conversions are typically limited by hard drive speed. Features PgDBF was designed with a few core principles: Simplicity. This code should be understandable by anyone who wants to hack it. Robustness. Every syscall that might possibly fail is checked for success. Speed. PgDBF was born to be the fastest conversion available anywhere. Completeness. It has full support for FoxPro memo files. Portability. PgDBF runs on 32- and 64-bit systems, and both little-endian (eg x86) and big-endian (eg PowerPC) architectures. Performance PgDBF's speed is generally limited by how fast it can read your hard drives. A striped RAID of quick disks can keep PgDBF pretty well fed on a single-processor system. One problem area is with memo files, which may become very internally fragmented as memo fields are created, deleted, and updated. For best results, consider placing the DBF and FPT files on a RAM drive so that there's no seek penalty as there is with spinning hard drives, or using a filesystem such as ZFS that caches aggressively. One particularly fragmented 160MB table with memo fields used to take over three minutes on a FreeBSD UFS2 filesystem. Moving the files to a RAM disk dropped the conversion time to around 1.2 seconds. A certain test table used during development comprises a 280MB DBF file and a 660MB memo file. PgDBF converts this to a 1.3 million row PostgreSQL table in about 11 seconds, or at a rate of almost 120,000 rows per second. OPTIONS
-c Generate a CREATE TABLE statement to make a table with similar datatypes and column names as the DBF file. Default. -C Suppress the CREATE TABLE statement. -d Generate a DROP TABLE statement before the CREATE TABLE statement. This is useful for replacing the contents of a table that already exists in PostgreSQL. Default. -D Suppress the DROP TABLE statement. -e Change the DROP TABLE statement to DROP TABLE IF EXISTS so that newer versions of PostgreSQL (8.2+) will only attempt to drop the table if it's already defined. PostgreSQL will return an error when attempting to drop a table that does not exist unless IF EXISTS is used. Default. -E Do not use the IF EXISTS modifier to DROP TABLE for compatibility with versions of PostgreSQL older than 8.2. -h Print a help message, then exit. -m memofile The name of the associated memo file (if necessary). -q Enclose the name of the table in quotation marks in statements like "CREATE TABLE", "DROP TABLE", and so on. This is useful in cases where the table name is a PostgreSQL reserved word, and almost certainly harmless in all other cases. -Q Do not enclose the name of the table in quotation marks. Default. -t Wrap the entire script in a transaction. Default. -T Remove the wrapper transaction. This is generally not a good idea as it can cause the table to appear completely empty to other clients during the data copying phase. If the entire process occurs inside a transaction, the update is atomic and other clients will have full access to all data in the table at all times. -u Issue a TRUNCATE TABLE statement to clear the contents of a table before copying data into it. -U Suppress the TRUNCATE TABLE statement. Default. OPTION NOTES
The -c and -d arguments are incompatible with -u as it's pointless to truncate a newly-created table. Specifying -c or -d will disable the TRUNCATE TABLE statement as though -U was given. Similarly, using the -u argument will disable the CREATE TABLE and DROP TABLE statements as if -C and -D were given. BUGS
When multiple incompatible interpretations of a type are available, such as the B type which can mean binary object in dBASE V or double- precision float in FoxPro, PgDBF currently uses the FoxPro interpretation. Most XBase datatypes are supported, but some are not (yet). As of this writing, PgDBF can handle boolean, currency, date, double-precision float, float, general (although only outputs empty strings; it's unclear how to resolve OLE objects at this time), integer, memo, numeric, timestamp, and varchar fields. If you need other datatypes, send a small sample database for testing. AUTHOR
Kirk Strauser <kirk@strauser.com> Version 0.5.5 February 3 2011 PGDBF(1)
All times are GMT -4. The time now is 07:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy