Sponsored Content
Top Forums Shell Programming and Scripting disk space utilization script Post 302482826 by svajhala on Wednesday 22nd of December 2010 04:14:19 PM
Old 12-22-2010
Hi,

My input file (integration_services.txt) look like this:

Code:
Intg_Svc01 /d1/Intg_Svc01 83886080
Intg_Svc02 /d2/Intg_Svc02 167772160
Intg_Svc03 /d3/Intg_Svc03 83886080
Intg_Svc04 /d4/Intg_Svc04 83886080

Yes it greps for each line of input and get the value in 2nd and 3rd column from above file.

Sam
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Frustrating Disk space script

This my frustrating disk space script that is supposed to send me a email whenever the disk space reaches 90% but this has some problem that just would not work ..can anyone please tell me when im going wrong #!/bin/ksh sendemail=-1 space=`df -bhk /users/siebelserver |awk '{print$5}'` echo... (4 Replies)
Discussion started by: vivsiv
4 Replies

2. Shell Programming and Scripting

Disk space script

Hi all, Can any one help me in making a disk space script in solaris 8/9 for instance i only want to get those partitions whose diskspace has exceed 70%. Any volunteer? Cheers! BR/asad (8 Replies)
Discussion started by: asadlone
8 Replies

3. Shell Programming and Scripting

Disk Space Monitoring Script

#!/bin/bash # Disk Space Monitoring for more than 95 % # and Sending Alerts by Mail if ; then `df -k |awk '$5 > 95 {print $1 " ----------- " $5}' |mailx -s "More than 95% disk usage in DEV" email@test.com'; else exit 0 fi I get the... (8 Replies)
Discussion started by: sriram003
8 Replies

4. Shell Programming and Scripting

Please help - disk space check script

I have a disk space check script that uses an exceptions file, the only issue with the script is that it does not work with values higher than the FSMAX=85 value. I have a file system that is at 92% and it doesn't change, so I would like to add it to the exceptions file. The exceptions file format... (0 Replies)
Discussion started by: maddhadder71
0 Replies

5. Shell Programming and Scripting

Script for Disk space

:( Hi All, i have 4 linux server for which i want set up script to monitor the disk space ... here my problem is i want the output like graph... also it should reflect in monitor ...as non stop process.. can any one suggest me any way where i can implement the script? ... (3 Replies)
Discussion started by: Shahul
3 Replies

6. Solaris

Disk space being used up while running a script

We have a script which when run consumes the space of the disk from where it is being run. we have to kill this script every time to release space. why do this happen ? any work around please we are using solaris 10 P.S. : a part of the code will make some connection to the DB (1 Reply)
Discussion started by: chidori
1 Replies

7. Shell Programming and Scripting

Need simpler way to find all my disk space utilization using df -h

Hi All, I am using SSH Tectia terminal to get the disk space utilization of a particular folder /opt/logs in all the servers one by one using the command df -h and looking through the list of folders manually to get /opt/logs folder disk space used percentage . The problem here is , it... (2 Replies)
Discussion started by: aakhan2011
2 Replies

8. Shell Programming and Scripting

I need help!! disk free space script

i want to write a shell script,when disk uses is 90% then automatically send a email to distribution list (group member)...... (1 Reply)
Discussion started by: sonu pandey
1 Replies

9. Shell Programming and Scripting

Disk Space Utilization in HTML format working in one environment and not working on the other

Hi Team, I have written the shell script which returns the result of the disk space filesystems which has crossed the threshold limit in HTML Format. Below mentioned is the script which worked perfectly on QA system. df -h | awk -v host=`hostname` ' BEGIN { print "<table border="4"... (13 Replies)
Discussion started by: Harihsun
13 Replies

10. UNIX for Beginners Questions & Answers

Disk space script

i have 3 servers and i am checking for the disk space of a specific mount-point, should not be more than 85 % considering example as below server1 mountpoint_1 has 70% diskutilization server2 mountpoint_1 has 80% diskutilization server3 mountpoint_1 has 7% diskutilization now when it... (6 Replies)
Discussion started by: abhaydas
6 Replies
NDB_CONFIG(1)						       MySQL Database System						     NDB_CONFIG(1)

NAME
ndb_config - extract MySQL Cluster configuration information SYNOPSIS
ndb_config options DESCRIPTION
This tool extracts current configuration information for data nodes, SQL nodes, and API nodes from one of a number of sources: a MySQL Cluster management node, or its config.ini or my.cnf file. By default, the management node is the source for the configuration data; to override the default, execute ndb_config with the --config-file or --mycnf option. It is also possible to use a data node as the source by specifying its node ID with --config_from_node=node_id. ndb_config can also provide an offline dump of all configuration parameters which can be used, along with their default, maximum, and minimum values and other information. The dump can be produced in either text or XML format; for more information, see the discussion of the --configinfo and --xml options later in this section). You can filter the results by section (DB, SYSTEM, or CONNECTIONS) using one of the options --nodes, --system, or --connections. The following table includes options that are specific to ndb_config. Additional descriptions follow the table. For options common to most MySQL Cluster programs (including ndb_config), see Options Common to MySQL Cluster Programs(1). Table 17.15. ndb_config Options and Variables: MySQL Cluster NDB 7.2 +----------------------------+--------------------------------------+-------------------------------------+ |Format | Description | Added / Removed | +----------------------------+--------------------------------------+-------------------------------------+ | | Print node information (DB section) | | | --nodes | only. | All MySQL 5.5 based releases | +----------------------------+--------------------------------------+-------------------------------------+ | | Print CONNECTIONS section | | | --connections | information only. Cannot be used | All MySQL 5.5 based releases | | | with --nodes | | | | or --system option. | | +----------------------------+--------------------------------------+-------------------------------------+ | | One or more query options | | | --query=string, | (attributes) | All MySQL 5.5 based releases | | | | | | -q | | | +----------------------------+--------------------------------------+-------------------------------------+ | | Specify host | | | --host=name | | All MySQL 5.5 based releases | +----------------------------+--------------------------------------+-------------------------------------+ | | Specify node type | | | --type=name | | All MySQL 5.5 based releases | +----------------------------+--------------------------------------+-------------------------------------+ | | Get configuration of node with this | | | --nodeid, | ID | All MySQL 5.5 based releases | | | | | | --id | | | +----------------------------+--------------------------------------+-------------------------------------+ | | Field separator | | | --fields=string, | | All MySQL 5.5 based releases | | | | | | -f | | | +----------------------------+--------------------------------------+-------------------------------------+ | | Row separator | | | --rows=string, | | All MySQL 5.5 based releases | | | | | | -r | | | +----------------------------+--------------------------------------+-------------------------------------+ | | Set the path to config.ini file | | | --config-file=path | | All MySQL 5.5 based releases | +----------------------------+--------------------------------------+-------------------------------------+ | | Read configuration data from my.cnf | | | --mycnf | file | All MySQL 5.5 based releases | +----------------------------+--------------------------------------+-------------------------------------+ | | Short form for --ndb-connectstring | | | -c | | All MySQL 5.5 based releases | +----------------------------+--------------------------------------+-------------------------------------+ | | Dumps information about all NDB | | | --configinfo | configuration parameters in text | All MySQL 5.5 based releases | | | format | | | | with default, maximum, | | | | and minimum values. Use with --xml | | | | to | | | | obtain XML output. | | +----------------------------+--------------------------------------+-------------------------------------+ | | Use --xml with --configinfo to | | | --configinfo --xml | obtain a dump of all NDB | All MySQL 5.5 based releases | | | configuration | | | | parameters in XML format | | | | with default, maximum, and minimum | | | | values. | | +----------------------------+--------------------------------------+-------------------------------------+ | | Print SYSTEM section information | | | --system | only. Cannot be used with --nodes or | All MySQL 5.5 based releases | | | --connections option. | | +----------------------------+--------------------------------------+-------------------------------------+ | | Obtain configuration data from the | | | --config_from_node=# | node having this ID (must be a data | All MySQL 5.5 based releases | | | node). | | +----------------------------+--------------------------------------+-------------------------------------+ o --usage, --help, or -? +--------------------+-----------+ |Command-Line Format | --help | +--------------------+-----------+ | | --usage | +--------------------+-----------+ | | -? | +--------------------+-----------+ Causes ndb_config to print a list of available options, and then exit. o --config_from_node=# +--------------------+----------------------+ |Command-Line Format | --config_from_node=# | +--------------------+----------------------+ | | Permitted Values | | +----------+-----------+ | | Type | numeric | | +----------+-----------+ | | Default | none | | +----------+-----------+ | | Range | 1 .. 48 | +--------------------+----------+-----------+ Obtain the cluster's configuration data from the data node that has this ID. If the node having this ID is not a data node, ndb_config fails with an error. (To obtain configuration data from the management node instead, simply omit this option.) o --version, -V +--------------------+-----------+ |Command-Line Format | --version | +--------------------+-----------+ | | -V | +--------------------+-----------+ Causes ndb_config to print a version information string, and then exit. o --ndb-connectstring=connect_string, -c connect_string +--------------------+-----------------------------------+ |Command-Line Format | --ndb-connectstring=connectstring | +--------------------+-----------------------------------+ | | --connect-string=connectstring | +--------------------+-----------------------------------+ | | -c | +--------------------+-----------------------------------+ | | Permitted Values | | +------------+----------------------+ | | Type | string | | +------------+----------------------+ | | Default | localhost:1186 | +--------------------+------------+----------------------+ Specifies the connection string to use in connecting to the management server. The format for the connection string is the same as described in Section 17.3.2.3, "MySQL Cluster Connection Strings", and defaults to localhost:1186. o --config-file=path-to-file +--------------------+---------------------+ |Command-Line Format | --config-file=path | +--------------------+---------------------+ | | Permitted Values | | +---------+-----------+ | | Type | file name | | +---------+-----------+ | | Default | | +--------------------+---------+-----------+ Gives the path to the management server's configuration file (config.ini). This may be a relative or absolute path. If the management node resides on a different host from the one on which ndb_config is invoked, then an absolute path must be used. o --mycnf +--------------------+-------------------+ |Command-Line Format | --mycnf | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | FALSE | +--------------------+---------+---------+ Read configuration data from the my.cnf file. o --query=query-options, -q query-options +--------------------+------------------+ |Command-Line Format | --query=string | +--------------------+------------------+ | | -q | +--------------------+------------------+ | | Permitted Values | | +---------+--------+ | | Type | string | | +---------+--------+ | | Default | | +--------------------+---------+--------+ This is a comma-delimited list of query options--that is, a list of one or more node attributes to be returned. These include id (node ID), type (node type--that is, ndbd, mysqld, or ndb_mgmd), and any configuration parameters whose values are to be obtained. For example, --query=id,type,indexmemory,datamemory returns the node ID, node type, DataMemory, and IndexMemory for each node. Note If a given parameter is not applicable to a certain type of node, than an empty string is returned for the corresponding value. See the examples later in this section for more information. o --host=hostname +--------------------+------------------+ |Command-Line Format | --host=name | +--------------------+------------------+ | | Permitted Values | | +---------+--------+ | | Type | string | | +---------+--------+ | | Default | | +--------------------+---------+--------+ Specifies the host name of the node for which configuration information is to be obtained. Note While the hostname localhost usually resolves to the IP address 127.0.0.1, this may not necessarily be true for all operating platforms and configurations. This means that it is possible, when localhost is used in config.ini, for ndb_config --host=localhost to fail if ndb_config is run on a different host where localhost resolves to a different address (for example, on some versions of SUSE Linux, this is 127.0.0.2). In general, for best results, you should use numeric IP addresses for all MySQL Cluster configuration values relating to hosts, or verify that all MySQL Cluster hosts handle localhost in the same fashion. o --id=node_id --nodeid=node_id +--------------------+-------------------+ |Command-Line Format | --ndb-nodeid=# | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | numeric | | +---------+---------+ | | Default | 0 | +--------------------+---------+---------+ Either of these options can be used to specify the node ID of the node for which configuration information is to be obtained. --nodeid is the preferred form. o --nodes +--------------------+-------------------+ |Command-Line Format | --nodes | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | FALSE | +--------------------+---------+---------+ Tells ndb_config to print information from parameters defined in DB sections only. This option cannot be used together with --connections or --system. o --connections +--------------------+-------------------+ |Command-Line Format | --connections | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | FALSE | +--------------------+---------+---------+ Tells ndb_config to print CONNECTIONS information only. This option cannot be used together with --nodes or --system. o --system +--------------------+-------------------+ |Command-Line Format | --system | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | FALSE | +--------------------+---------+---------+ Tells ndb_config to print SYSTEM information only. This option cannot be used together with the --nodes or --system options. o --type=node_type +--------------------+----------------------------+ |Command-Line Format | --type=name | +--------------------+----------------------------+ | | Permitted Values | | +--------------+-------------+ | | Type | enumeration | | +--------------+-------------+ | | Default | | | +--------------+-------------+ | | Valid Values | ndbd | | | +-------------+ | | | mysqld | | | +-------------+ | | | ndb_mgmd | +--------------------+--------------+-------------+ Filters results so that only configuration values applying to nodes of the specified node_type (ndbd, mysqld, or ndb_mgmd) are returned. o --fields=delimiter, -f delimiter +--------------------+------------------+ |Command-Line Format | --fields=string | +--------------------+------------------+ | | -f | +--------------------+------------------+ | | Permitted Values | | +---------+--------+ | | Type | string | | +---------+--------+ | | Default | | +--------------------+---------+--------+ Specifies a delimiter string used to separate the fields in the result. The default is "," (the comma character). Note If the delimiter contains spaces or escapes (such as for the linefeed character), then it must be quoted. o --rows=separator, -r separator +--------------------+------------------+ |Command-Line Format | --rows=string | +--------------------+------------------+ | | -r | +--------------------+------------------+ | | Permitted Values | | +---------+--------+ | | Type | string | | +---------+--------+ | | Default | | +--------------------+---------+--------+ Specifies a separator string used to separate the rows in the result. The default is a space character. Note If the separator contains spaces or escapes (such as for the linefeed character), then it must be quoted. o --configinfo The --configinfo option causes ndb_config to dump a list of each MySQL Cluster configuration parameter supported by the MySQL Cluster distribution of which ndb_config is a part, including the following information: o A brief description of each parameter's purpose, effects, and usage o The section of the config.ini file where the parameter may be used o The parameter's data type or unit of measurement o Where applicable, the parameter's default, minimum, and maximum values o A brief description of the parameter's purpose, effects, and usage o MySQL Cluster release version and build information By default, this output is in text format. Part of this output is shown here: shell> ndb_config --configinfo ****** SYSTEM ****** Name (String) Name of system (NDB Cluster) MANDATORY PrimaryMGMNode (Non-negative Integer) Node id of Primary ndb_mgmd(MGM) node Default: 0 (Min: 0, Max: 4294967039) ConfigGenerationNumber (Non-negative Integer) Configuration generation number Default: 0 (Min: 0, Max: 4294967039) ****** DB ****** MaxNoOfSubscriptions (Non-negative Integer) Max no of subscriptions (default 0 == MaxNoOfTables) Default: 0 (Min: 0, Max: 4294967039) MaxNoOfSubscribers (Non-negative Integer) Max no of subscribers (default 0 == 2 * MaxNoOfTables) Default: 0 (Min: 0, Max: 4294967039) ... --configinfo --xml +--------------------+--------------------+ |Command-Line Format | --configinfo --xml | +--------------------+--------------------+ | | Permitted Values | | +----------+---------+ | | Type |boolean | | +----------+---------+ | | Default |false | +--------------------+----------+---------+ You can obtain the output of ndb_config --configinfo as XML by adding the --xml option. A portion of the resulting output is shown in this example: shell> ndb_config --configinfo --xml <configvariables protocolversion="1" ndbversionstring="5.5.35-ndb-7.2.15" ndbversion="458758" ndbversionmajor="7" ndbversionminor="0" ndbversionbuild="6"> <section name="SYSTEM"> <param name="Name" comment="Name of system (NDB Cluster)" type="string" mandatory="true"/> <param name="PrimaryMGMNode" comment="Node id of Primary ndb_mgmd(MGM) node" type="unsigned" default="0" min="0" max="4294967039"/> <param name="ConfigGenerationNumber" comment="Configuration generation number" type="unsigned" default="0" min="0" max="4294967039"/> </section> <section name="NDBD"> <param name="MaxNoOfSubscriptions" comment="Max no of subscriptions (default 0 == MaxNoOfTables)" type="unsigned" default="0" min="0" max="4294967039"/> <param name="MaxNoOfSubscribers" comment="Max no of subscribers (default 0 == 2 * MaxNoOfTables)" type="unsigned" default="0" min="0" max="4294967039"/> ... </section> ... </configvariables> Note Normally, the XML output produced by ndb_config --configinfo --xml is formatted using one line per element; we have added extra whitespace in the previous example, as well as the next one, for reasons of legibility. This should not make any difference to applications using this output, since most XML processors either ignore nonessential whitespace as a matter of course, or can be instructed to do so. The XML output also indicates when changing a given parameter requires that data nodes be restarted using the --initial option. This is shown by the presence of an initial="true" attribute in the corresponding <param> element. In addition, the restart type (system or node) is also shown; if a given parameter requires a system restart, this is indicated by the presence of a restart="system" attribute in the corresponding <param> element. For example, changing the value set for the Diskless parameter requires a system initial restart, as shown here (with the restart and initial attributes highlighted for visibility): <param name="Diskless" comment="Run wo/ disk" type="bool" default="false" restart="system" initial="true"/> Currently, no initial attribute is included in the XML output for <param> elements corresponding to parameters which do not require initial restarts; in other words, initial="false" is the default, and the value false should be assumed if the attribute is not present. Similarly, the default restart type is node (that is, an online or "rolling" restart of the cluster), but the restart attribute is included only if the restart type is system (meaning that all cluster nodes must be shut down at the same time, then restarted). Important The --xml option can be used only with the --configinfo option. Using --xml without --configinfo fails with an error. Unlike the options used with this program to obtain current configuration data, --configinfo and --xml use information obtained from the MySQL Cluster sources when ndb_config was compiled. For this reason, no connection to a running MySQL Cluster or access to a config.ini or my.cnf file is required for these two options. Combining other ndb_config options (such as --query or --type) with --configinfo or --xml is not supported. Currently, if you attempt to do so, the usual result is that all other options besides --configinfo or --xml are simply ignored. However, this behavior is not guaranteed and is subject to change at any time. In addition, since ndb_config, when used with the --configinfo option, does not access the MySQL Cluster or read any files, trying to specify additional options such as --ndb-connectstring or --config-file with --configinfo serves no purpose. Examples 1. To obtain the node ID and type of each node in the cluster: shell> ./ndb_config --query=id,type --fields=':' --rows=' ' 1:ndbd 2:ndbd 3:ndbd 4:ndbd 5:ndb_mgmd 6:mysqld 7:mysqld 8:mysqld 9:mysqld In this example, we used the --fields options to separate the ID and type of each node with a colon character (:), and the --rows options to place the values for each node on a new line in the output. 2. To produce a connection string that can be used by data, SQL, and API nodes to connect to the management server: shell> ./ndb_config --config-file=usr/local/mysql/cluster-data/config.ini --query=hostname,portnumber --fields=: --rows=, --type=ndb_mgmd 192.168.0.179:1186 3. This invocation of ndb_config checks only data nodes (using the --type option), and shows the values for each node's ID and host name, as well as the values set for its DataMemory, IndexMemory, and DataDir parameters: shell> ./ndb_config --type=ndbd --query=id,host,datamemory,indexmemory,datadir -f ' : ' -r ' ' 1 : 192.168.0.193 : 83886080 : 18874368 : /usr/local/mysql/cluster-data 2 : 192.168.0.112 : 83886080 : 18874368 : /usr/local/mysql/cluster-data 3 : 192.168.0.176 : 83886080 : 18874368 : /usr/local/mysql/cluster-data 4 : 192.168.0.119 : 83886080 : 18874368 : /usr/local/mysql/cluster-data In this example, we used the short options -f and -r for setting the field delimiter and row separator, respectively. 4. To exclude results from any host except one in particular, use the --host option: shell> ./ndb_config --host=192.168.0.176 -f : -r ' ' -q id,type 3:ndbd 5:ndb_mgmd In this example, we also used the short form -q to determine the attributes to be queried. Similarly, you can limit results to a node with a specific ID using the --id or --nodeid option. COPYRIGHT
Copyright (C) 1997, 2014, Oracle and/or its affiliates. All rights reserved. This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. SEE ALSO
For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available online at http://dev.mysql.com/doc/. AUTHOR
Oracle Corporation (http://dev.mysql.com/). MySQL 5.5 01/30/2014 NDB_CONFIG(1)
All times are GMT -4. The time now is 10:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy