10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi ,
can anyone help me in this
Input file
Name= XYZ
Company= ALPHA
City= Stockhomn
Equipment=computer
Country=Sweden
Name=MNC
Company=Beta
City=Kaulampur
Equipment=computer
Country=Malaysia
Name=JVC
Company=gamma
City=Kiruna (3 Replies)
Discussion started by: swets
3 Replies
2. Shell Programming and Scripting
Hi,
I have a file which contents entries in this form.
Only in /data4/temp abc.000001
Only in /data4/temp abc.000003
Only in /data4/temp abc.000012
Only in /data4/temp abc.000120
Only in /data4/temp abc.000133
Only in /data4/temp abc.001444
i want to read line by line and format... (2 Replies)
Discussion started by: arijitsaha
2 Replies
3. Shell Programming and Scripting
Hi,
I need to connect to the database and retrieve two variables from the database and store them in a variable,out of these two variables I need to get lastdigit appended to the variable 1 retrieved and variable 2 with out any modification
in short
select var,data from usage;
o/p=... (1 Reply)
Discussion started by: rkrish
1 Replies
4. Shell Programming and Scripting
below is a CPU utilization Log for ABC server.
However for every 15 minutes it generates 3 CPU values(with interval of 2 sec).
Host CPU CPUtotal CPU% time
ABC 101.1 2 50.55 14 : 15
ABC 100.5 2 50.25 14 : 15
ABC 100.2 2 50.1 14 : 15
ABC 100.9 2 50.45 14 : 30
ABC 100.5 2 50.25 14 : 30
ABC... (5 Replies)
Discussion started by: pinga123
5 Replies
5. Shell Programming and Scripting
I have input file in this way
John 1234 BASIC 26000
John 1234 ALLOWC 01550
John 1234 INCER 01700
John 1234 REL 20000
Debi 2345 BASIC 29000
Debi 2345 ALLOWC 01600
Debi 2345 INCR 01900
Debi 2345 REL ... (8 Replies)
Discussion started by: vakharia Mahesh
8 Replies
6. Shell Programming and Scripting
my script is as follows
cnt=`ps -ef |grep pmon|grep -v grep|awk 'END {{print NR}}'`
cnt2=`ps -ef |grep tns|grep -v grep|awk 'END {{print NR}}'`
if
then
if
then
rman target/ catalog recdb/recdb@recdb cmdfile report_need_backup.sql > report_need_backup.txt
... (1 Reply)
Discussion started by: swkambli
1 Replies
7. Shell Programming and Scripting
I am using find and ls to search for "warez" files on my server.
find /home/ -regex ".*\.\(avi\|mp3\|mpeg\|mpg\|iso\)" -print0 | xargs -0 ls -oh
This command produces this:
-rw-r--r-- 1 1000 3.2M Feb 18 2009 /home/user/public_html/lupus.mp3
I want to only get this
3.2M... (4 Replies)
Discussion started by: bonrad
4 Replies
8. Shell Programming and Scripting
Is it possible to convert the attached file to the format mentioned.
Here for a particular job the table name and the corresponding instance name from one test run "X" is compared with the table name and the instance name from the second test run "Y" for output rows,affected rows,applied... (1 Reply)
Discussion started by: ragavhere
1 Replies
9. Shell Programming and Scripting
Hi,
I am new to shell scripting, I ahve written a shell script which would extract me data, but my problem is I want to add a column name to my output. Using grep and sed I am getting my data from the input file.
Sample data
name : eric
name : tom
name : sean
My output using grep and sed... (3 Replies)
Discussion started by: illur81
3 Replies
10. Shell Programming and Scripting
Hi all,
Have the following code(1) producing the results(2 & 3).
Would like to know if there is a way to format the two reports created in a similar fashion.
IE - The first is formatted nicely as a result of the echo "$xmpbdate $xavgs" >> $xmpbrpt
However when I attempt to do the same on... (7 Replies)
Discussion started by: Cameron
7 Replies
ENVSYS.CONF(5) BSD File Formats Manual ENVSYS.CONF(5)
NAME
envsys.conf -- configuration file for the envsys(4) framework
SYNOPSIS
envstat [-S] [-c /etc/envsys.conf]
DESCRIPTION
The envsys.conf file configures all the features provided by the envsys(4) framework. It consists of a series of device and sensor blocks.
Each sensor block defines a group of properties. The file format is free-form: new line markers and indentation are ignored. Comments start
with a '#' sign and extend until the end of line.
A property is like a variable assignment. It has a name, which goes to the left of the equal sign, and a value, which goes to the right.
The assignment ends with a semicolon. It looks like:
name = value;
There is no difference between string or integer values when defining them. The value must be surrounded by double quotes if it contains
whitespace.
There can be multiple groups of devices and multiple groups of sensors in the configuration file.
A device block consists of one or more sensor blocks and one or more global properties. It has the following syntax:
device_name {
prop = value;
...
sensor0 {
prop = value;
...
}
...
sensorN {
prop = value;
...
}
}
...
Device names are those shown by the 'envstat -D' command; sensor blocks are named by the index position in which they are shown.
For example, if we have the following output from the envstat(8) command:
CPU Temperature: 32.000 degC
MB Temperature: 37.000 degC
Vcore Voltage: 1.232 V
+3.3 Voltage: 3.248 V
+5 Voltage: 4.992 V
+12 Voltage: 11.985 V
CPU FAN Speed: 1250 RPM
'sensor0' corresponds to the CPU Temperature sensor and 'sensor6' corresponds to the CPU FAN Speed sensor.
There is another way that will give you the correct index sensor; the 'envstat -x' command will print the raw XML property list. You only
have to find the index object in the appropriate dictionary. The object will be shown as:
<key>index</key>
<string>sensor2</string>
Invalid sensors and devices will be detected by the envstat(8) parser and will be reported as errors.
The following properties are provided for sensor blocks (please note that not all properties apply to all type of sensors):
critical-capacity = 10;
Sets a critical capacity limit property of 10 percent in a battery sensor. Battery sensors are those that report a percentage from
the envstat(8) output.
It is possible to find out if the sensor accepts this property by running 'envstat -x' and looking if the want-percentage object is
defined as true on its dictionary. For example:
<key>want-percentage</key>
<true/>
Only a value between 0 and 100 is allowed. When the limit is reached in the sensor, a critical-capacity event will be sent to the
powerd(8) daemon (if running) and will execute the block for this event in /etc/powerd/scripts/sensor_battery.
If this property is set, its value will be shown in the envstat(8) display output with a column named CritMin.
warning-capacity = 20;
Sets a warning capacity limit property of 20 percent in a battery sensor. Battery sensors are those that report a percentage from the
envstat(8) output.
It is possible to find out if the sensor accepts this property by running 'envstat -x' and looking if the want-percentage object is
defined as true on its dictionary. For example:
<key>want-percentage</key>
<true/>
Only a value between 0 and 100 is allowed. When the limit is reached in the sensor, a warning-capacity event will be sent to the
powerd(8) daemon (if running) and will execute the block for this event in /etc/powerd/scripts/sensor_battery.
If this property is set, its value will be shown in the envstat(8) display output with a column named WarnMin.
high-capacity = 90;
Sets a high capacity limit property of 90 percent in a battery sensor. Battery sensors are those that report a percentage from the
envstat(8) output.
It is possible to find out if the sensor accepts this property by running 'envstat -x' and looking if the want-percentage object is
defined as true on its dictionary. For example:
<key>want-percentage</key>
<true/>
Only a value between 0 and 100 is allowed. When the limit is reached in the sensor, a high-capacity event will be sent to the
powerd(8) daemon (if running) and will execute the block for this event in /etc/powerd/scripts/sensor_battery.
If this property is set, its value will be shown in the envstat(8) display output with a column named WarnMax.
maximum-capacity = 99;
Sets a warning capacity limit property of 99 percent in a battery sensor. Battery sensors are those that report a percentage from the
envstat(8) output.
It is possible to find out if the sensor accepts this property by running 'envstat -x' and looking if the want-percentage object is
defined as true on its dictionary. For example:
<key>want-percentage</key>
<true/>
Only a value between 0 and 100 is allowed. When the limit is reached in the sensor, a warning-capacity event will be sent to the
powerd(8) daemon (if running) and will execute the block for this event in /etc/powerd/scripts/sensor_battery.
If this property is set, its value will be shown in the envstat(8) display output with a column named WarnMin.
critical-max = 70C;
Sets a critical maximum limit property in a sensor. Note that in this example, we are specifying the 'C' keyword at the end; that
means that this will only be valid for temperature sensors and that the value is specified as degrees Celsius. If degrees Fahrenheit
are wanted, just use the letter F, as in:
critical-max = 140F;
To know sensor type, you have to look at the type object in the XML property list. Remember: the XML property list has all the infor-
mation that the application uses to print the values!
Other sensors that are not of temperature type must not include the final character for the unit. A dot is allowed in the value, if
it corresponds to the range that the sensor is reporting. When the limit has been reached in the sensor, a critical-over event will
be sent to the powerd(8) daemon (if running) and will execute the block for this event in the appropriate
/etc/powerd/scripts/sensor_foo script (depending on the sensor's type).
Please note that this property cannot be set in battery capacity sensors (those that have the want-percentage object in their dictio-
nary). This rule applies for the 'critical-min', 'warning-max', and 'warning-min' properties too.
If this property is set, its value will be shown in the envstat(8) display output with a column named CritMax.
critical-min = 1.230;
Sets a critical minimum limit property in a sensor. The rules for critical-max, critical-min, warning-max, and warning-min are the
same. When the limit has been reached in the sensor, a critical-under event will be sent to the powerd(8) daemon (if running) and
will execute the block for this event in the appropriate /etc/powerd/scripts/sensor_foo script (depending on the sensor's type).
If this property is set, its value will be shown in the envstat(8) display output with a column named CritMin.
warning-max = 70C;
Sets a warning maximum limit property in a sensor. The rules for critical-max, critical-min, warning-max, and warning-min are the
same. When the limit has been reached in the sensor, a warning-over event will be sent to the powerd(8) daemon (if running) and will
execute the block for this event in the appropriate /etc/powerd/scripts/sensor_foo script (depending on the sensor's type).
Please note that this property cannot be set in battery capacity sensors (those that have the want-percentage object in their dictio-
nary). This rule applies for the 'warning-min' property too.
If this property is set, its value will be shown in the envstat(8) display output with a column named WarnMax.
warning-min = 1.230;
Sets a critical minimum limit property in a sensor. The rules for critical-max, critical-min, warning-max, and warning-min are the
same. When the limit has been reached in the sensor, a warning-under event will be sent to the powerd(8) daemon (if running) and will
execute the block for this event in the appropriate /etc/powerd/scripts/sensor_foo script (depending on the sensor's type).
If this property is set, its value will be shown in the envstat(8) display output with a column named WarnMin.
description = string
Sets a new description in a sensor. You can set this property in all sensors, except that you won't be able to set a description that
is currently used for the specified device.
rfact = 56000
Sets a new resistor factor property in a sensor. This property is only allowed in Voltage sensors and only if the device has enabled
the appropriate flag for the mentioned sensor. The resistor factor may be used to change the behavior of the value returned by the
device.
If a sensor supports this, the allow-rfact object appears enabled (true) in the dictionary.
The following properties are available for device blocks:
refresh-timeout = 10s
This property sets the refresh timeout value in a device, and will be used to refresh data and check for critical conditions any time
the timeout is met. The value may be specified in seconds, minutes or hours. To specify the value in seconds, the s character must
be appended last, if minutes is desired, a m and a h for hours. For example 10s for 10 seconds or 1h for one hour.
FILES
/etc/envsys.conf Default configuration file.
SEE ALSO
proplib(3), envsys(4), envstat(8), powerd(8)
HISTORY
The envsys.conf configuration file first appeared in NetBSD 5.0.
BSD
February 15, 2010 BSD