Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Manipulate condition to send mail based on output text in file Post 303038882 by RudiC on Monday 16th of September 2019 09:51:25 AM
Old 09-16-2019
The first grep retrieves the line "Return Code n", the second extracts the number n which becomes the result of the "command substitution" which in turn serves as an index into the RT array:
0 ->Success
2 -> Failure
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Send text file to mail

I have a utility that opens a telnet session and allows me to execute commands through a script. The utility allows me to output to a text file whatever is outputted to screen. This utility runs from a DOS prompt in Windows 95/98, NT or 2000. How can I mail text file this to a certain user. I... (2 Replies)
Discussion started by: petrosi
2 Replies

2. UNIX for Advanced & Expert Users

How to parse through a file and based on condition form another output file

I have one file say CM.txt which contains values like below.Its just a flat file 1000,A,X 1001,B,Y 1002,B,Z ... .. total around 4 million lines of entries will be in that file. Now i need to write another file CM1.txt which should have 1000,1 1001,2 1002,3 .... ... .. Here i... (6 Replies)
Discussion started by: sivasu.india
6 Replies

3. Shell Programming and Scripting

Send a mail to IDs listed in a text file

I have a list of mail ids in text file and want a ksh script that reads this text file and sends a mail to all mail ids with same subject line and content. I am using UX-HP machine and KSH. Thanks for help in advance! (5 Replies)
Discussion started by: Sriranga
5 Replies

4. UNIX for Advanced & Expert Users

Output will send in mail

Hi All, Requirement is to select the data from database and send the output in mail. But the output should in HTML tabular format in mail body. For example my select command is : select ename,esal,edegn,dept from emp where deptno in (10,15); In the mail body the output should : Employee... (3 Replies)
Discussion started by: alex_us
3 Replies

5. UNIX for Advanced & Expert Users

send mail script only if condition is met

only wc -l greater than 0 then send email to owner, otherwise do nothing. ie. result=powermt display dev=all|awk '{print $7}'|grep -i dead|wc -l if then echo $result else : fi mailx -s "there is dead path (s)" "mymail@mydomain.com" ----------- it is not working... (2 Replies)
Discussion started by: orafup
2 Replies

6. Shell Programming and Scripting

Help with File processing - Adding predefined text to particular record based on condition

I am generating a output: Name Count_1 Count_2 abc 12 12 def 15 14 ghi 16 16 jkl 18 18 mno 7 5 I am sending the output in html email, I want to add the code: <font color="red"> NAME COLUMN record </font> for the Name... (8 Replies)
Discussion started by: karumudi7
8 Replies

7. Shell Programming and Scripting

Replace text inside XML file based on condition

Hi All, I want to change the name as SEQ_13 ie., <Property Name="Name">SEQ_13</Property> when the Stage Type is PxSequentialFile ie., <Property Name="StageType">PxSequentialFile</Property> :wall: Input.XML <Main> <Record Identifier="V0S13" Type="CustomStage" Readonly="0">... (3 Replies)
Discussion started by: kmsekhar
3 Replies

8. Shell Programming and Scripting

Send mail based on a group

Hello Gurus, I have a question. I have a file which has 2 columns and is tab separated and looks like below: FIELD1 FIELD2 Manual m456@hotmail.com Execution din098@gmail.com Artistic m456@hotmail.com Graphic din098@gmail.com FIELD2 values will have always either of the 2 above... (8 Replies)
Discussion started by: Max499
8 Replies

9. UNIX for Advanced & Expert Users

Group the records based on empno and send mail

Hi All, I have records in a file with name,SSO,openitems,manageremail with | delimited file.Now i want to group the records by SSO and openitems and send email to their manageremail. kiran|1111|draft|aaa@gmail.com guna|2222|reject|bbb@gmail.com kiran|1111|submitter|aaa@gmail.com... (2 Replies)
Discussion started by: kiranparsha
2 Replies

10. UNIX for Beginners Questions & Answers

Read a file and send mail based on grep

Hi All, I am having a job and I need to send email when the job is running. On any other case (success,fail) I don't needed to send email. I check with BMC they told they dont have that in the version I am using. So I created a dependent job and grepped for the status and sent email. My... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
Munin::Master::Utils(3pm)				User Contributed Perl Documentation				 Munin::Master::Utils(3pm)

NAME
Munin::Master::Utils - Exports a lot of utility functions. SYNOPSIS
use Munin::Master::Utils; SUBROUTINES
munin_category_status Gets current status of a category. Parameters: - $hash: A ref to the hash node whose children to check - $limits: A ref to the root node of the limits tree - $category: The category to review - $check_draw: [optional] Ignore undrawn fields Returns: - Success: The status of the field - Failure: undef munin_config munin_copy_node Copy hash node. Parameters: - $from: Hash node to copy - $to: Where to copy it to Returns: - Success: $to - Failure: undef munin_copy_node_toloc Copy hash node at. Parameters: - $from: Hash node to copy - $to: Where to copy it to - $loc: Path to node under $to Returns: - Success: $to - Failure: undef munin_createlock munin_delete munin_draw_field Check whether a field will be visible in the graph or not. Parameters: - $hash: A ref to the hash node for the field Returns: - Success: Boolean; true if field will be graphed, false if not - Failure: undef munin_field_status Gets current status of a field. Parameters: - $hash: A ref to the field hash node - $limits: A ref to the root node of the limits tree - $check_draw: [optional] Ignore undrawn fields Returns: - Success: The status of the field - Failure: undef munin_find_field Search a hash to find hash nodes with $field defined. Parameters: - $hash: A hash ref to search - $field: The name of the field to search for, or a regex - $avoid: [optional] Stop traversing further down if this field is found Returns: - Success: A ref to an array of the hash nodes containing $field. - Failure: undef munin_get Get variable. Parameters: - $hash: Ref to hash node - $field: Name of field to get - $default: [optional] Value to return if $field isn't set Returns: - Success: field contents - Failure: $default if defined, else undef munin_get_bool Get boolean variable. Parameters: - $hash: Ref to hash node - $field: Name of field to get - $default: [optional] Value to return if $field isn't set Returns: - Success: 1 or 0 (true or false) - Failure: $default if defined, else undef munin_get_bool_val munin_get_children Get all child hash nodes. Parameters: - $hash: A hash ref to the parent node Returns: - Success: A ref to an array of the child nodes - Failure: undef munin_get_field_order Get the field order in a graph. Parameters: - $hash: A hash ref to the service Returns: - Success: A ref to an array of the field names - Failure: undef munin_get_filename Get rrd filename for a field, without any bells or whistles. Used by munin-update to figure out which file to update. Parameters: - $hash: Ref to hash field Returns: - Success: Full path to rrd file - Failure: undef munin_get_html_filename Get the full path-name of an html file. Parameters: - $hash: A ref to the service hash node Returns: - Success: The file name with full path - Failure: undef munin_get_max_label_length Get the length of the longest labe in a graph. Parameters: - $hash: the graph in question - $order: A ref to an array of fields (graph_order) Returns: - Success: The length of the longest label in the graph - Failure: undef munin_get_node Gets a node by loc. Parameters: - $hash: A ref to the hash to set the variable in - $loc: A ref to an array with the full path of the node Returns: - Success: The node ref found by $loc - Failure: undef munin_get_node_loc Get location array for hash node. Parameters: - $hash: A ref to the node Returns: - Success: Ref to an array with the full path of the variable - Failure: undef munin_get_node_name Return the name of the hash node supplied. Parameters: - $hash: A ref to the hash node Returns: - Success: The name of the node munin_get_node_partialpath Gets a node from a partial path. Parameters: - $hash: A ref to the "current" location in the hash tree - $var: A path string with relative location (from the $hash). Returns: - Success: The node - Failure: undef munin_get_parent Get parent node of a hash. Parameters: - $hash: A ref to the node Returns: - Success: Ref to an parent - Failure: undef munin_get_parent_name Return the name of the parent of the hash node supplied Parameters: - $hash: A ref to the hash node Returns: - Success: The name of the parent node - Failure: If no parent node exists, "none" is returned. munin_get_picture_filename Get the full path+name of a picture file. Parameters: - $hash: A ref to the service hash node - $scale: [optional] The scale (day, week, year, month) - $sum: [optional] Boolean value, whether it's a sum graph or not. Returns: - Success: The file name with full path - Failure: undef munin_get_picture_loc Get location array for hash node for picture purposes. Differs from munin_get_node_loc in that it honors #%#origin metadata Parameters: - $hash: A ref to the node Returns: - Success: Ref to an array with the full path of the variable - Failure: undef munin_get_root_node Get the root node of the hash tree. Parameters: - $hash: A hash node to traverse up from Returns: - Success: A ref to the root hash node - Failure: undef munin_get_rrd_filename Get the name of the rrd file corresponding to a field. Checks for lots of bells and whistles. This function is the correct one to use when figuring out where to fetch data from. Parameters: - $field: The hash object of the field - $path: [optional] The path to the field (as given in graph_order/sum/stack/et al) Returns: - Success: A string with the filename of the rrd file - Failure: undef munin_get_separated_node Copy a node to a separate node without "specials". Parameters: - $hash: The node to copy Returns: - Success: A ref to a new node without "#%#"-fields - Failure: undef munin_get_var_path munin_getlock munin_graph_column_headers munin_has_subservices munin_has_subservices($hash); Checks whether the service represented by $hash has subservices (multigraph), and returns the result. Parameters: - $hash: Hash reference pointing to a service Returns: - true: if the hash is indeed a service, and said service has got subservices - false: otherwise munin_mkdir_p munin_mkdir_p('/a/path/', oct('777')); Make a directory and recursivly any nonexistent directory in the path to it. munin_node_status munin_nscasend munin_overwrite Take contents of one config-namespace and replace/insert the instances needed. munin_parse_config munin_path_to_loc Returns a loc array from a path string. Parameters: - $path: A path string Returns: - Success: A ref to an array with the loc - Failure: undef munin_readconfig munin_removelock munin_runlock munin_service_status Gets current status of a service. Parameters: - $hash: A ref to the field hash node - $limits: A ref to the root node of the limits tree - $check_draw: [optional] Ignore undrawn fields Returns: - Success: The status of the field - Failure: undef munin_set Sets a variable in a hash. Parameters: - $hash: A ref to the hash to set the variable in - $var: The name of the variable - $val: The value to set the variable to Returns: - Success: The $hash we were handed - Failure: undef munin_set_var_loc Sets a variable in a hash. Parameters: - $hash: A ref to the hash to set the variable in - $loc: A ref to an array with the full path of the variable - $val: The value to set the variable to Returns: - Success: The $hash we were handed - Failure: undef munin_set_var_path Sets a variable in a hash. Parameters: - $hash: A ref to the hash to set the variable in - $var: A string with the full path of the variable - $val: The value to set the variable to Returns: - Success: The $hash we were handed - Failure: The $hash we were handed munin_writeconfig munin_writeconfig_loop COPYING
Copyright (C) 2003-2007 Jimmy Olsen, Audun Ytterdal This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991. This program 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 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. perl v5.14.2 2013-11-12 Munin::Master::Utils(3pm)
All times are GMT -4. The time now is 11:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy