Sponsored Content
Top Forums Shell Programming and Scripting Shell program to accept multiple request at the same time Post 302202611 by tcskurra on Thursday 5th of June 2008 09:24:16 AM
Old 06-05-2008
Quote:
Originally Posted by era
Show us the code.

Hi the code is as following

#!/bin/sh
#WORKDIR='X:/Tivoli/bin/w32-ix86/TME/TEC/TCS_ACTIVE/TECTASK'
email_id=`perl X:/Tivoli/bin/w32-ix86/TME/TEC/TCS_ACTIVE/TECTASK/ip_mail.pl $hostname`
echo "|$email_id|\n"
#echo "|$branch|\n"
#echo "|$location|\n"
branch=`echo $email_id|cut -d ";" -f 1`
location=`echo $email_id|cut -d ";" -f 2`
email=`echo $email_id|cut -d ";" -f 3`
to_email_id=`echo $email|cut -d ":" -f 1`
cc_email_id=`echo $email|cut -d ":" -f 2`
alias_name=`echo $email|cut -d ":" -f 3`


TO=$to_email_id
CC=$cc_email_id

MAIL_MESSAGE="
Dear Administrator,\n
Tivoli Monitoring event received with the following information :\n
\n
HostName : $hostname\n
IP_Address : $origin\n
SITUATION : $situation_name \n
Severity : $severity\n
Cause : $situation_displayitem\n
Occurence : $situation_time\n
\n
The details of the event are as below :\n
\n
Message : The Logical VOlume $situation_displayitem on the server $hostname is $pct__used % full. Currently the free space is $free_megabytes MB.\n

\n
To view the current status of the server, log on to \n
http://XX.XX.XX.XX///cnp/kdh/lib/cnp.html
\n
Note: This is a auto generated email please do not reply back.\n
In case of any queries please contact local Tivoli Coordinators.\n
\n
\n


SUBJECT="The Situation $situation_name triggered on the server $hostname "

X="$(X:/sendEmail -f tivoli.monitoring@tcs.com -t $TO -cc $CC -u $SUBJECT -m "$MAIL_MESSAGE" -s XX.XX.XX.XX)"
echo "$branch;$location;$hostname;$situation_name;$X to $TO " >>X:/mail.log
echo "$branch;$location;$hostname;$situation_name;$timestamp;$msg;$TO;$X" >>X:/event.log


X:/count/disk_mail.sh $cms_hostname $situation_name $situation_origin $origin $adapter_host $timestamp $TO $CC


The last line in bold is where i am calling the db2 stored procedure from the shell file disk_mail.sh. All the above code is ment for sending the email based on the parameters recived from Tivoli.

Db2 stored procedure is inside X:/count/disk_mail.sh and this has the following code.

db2cmd /w /i << EOF
echo "--------------------------------------------------------------------------------------------------------" >> "X:/reports/track_disk.txt"
db2 connect to XXXX User XXXX using XXXX
db2 call ITMUSER.MAIL_TRACK_SP('$1','$2','$3',current_timestamp,'$4','$5','$6','$7','$8') >> "X:/reports/track_disk.txt"
EOF
echo "inserted values sucessfully $2 $3" >> "X:/reports/track_disk.txt"
echo "---------------------------------------------------------------------------------------------------------" >> "X:/reports/track_disk.txt"
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

problem accessing Multiple Variables from C Program to a Shell script

program name--test #!/bin/bash output1=`/home/user/a.c` output2=`/home/user/a.c` k=`$output1 + 1` m=`$output2 + 1` echo $k echo $m --------------------------------------------------------------------------- prgram name--a.c #include<stdio.h> int main() (1 Reply)
Discussion started by: sameworld1980
1 Replies

2. Shell Programming and Scripting

How to accept multiple input in a same variable

Hi All, I am trying to write a script in which I need to accept multiple value in the same variable. The case Is that I have put a FOR loop and inside the FOR loop I am accepting a variable value. And I require all the values which gets inputted in the variable. To be... (5 Replies)
Discussion started by: rahulmittal87
5 Replies

3. Shell Programming and Scripting

Shell script to run a python program on multiple entries in a file

Hello I am trying to run a python program using shell script, which takes a single argument from a file. This file has one entry per line : 1aaa 2bbb 3ccc 4ddd 5eee ... ... ... My shell script runs the program, only for the last entry : #!/bin/sh IFS=$'\n' for line in $(cat... (2 Replies)
Discussion started by: ad23
2 Replies

4. Cybersecurity

configure apache to accept request form specific IP

Hi, What should I change in the httpd.conf so that the apache will accept request from page from specific IP and deny all the rest IP. I am reading the document of the apache but it is very long (700 pages) and I searched but I could not find something about this. So if someone can explain... (0 Replies)
Discussion started by: programAngel
0 Replies

5. Programming

How to accept multiple lines input from User in C?

Hi I want to accept multiple lines input with spaces from User and i have a working code like this. char sRes; char sReq; printf("Please enter request:"); scanf("%",sReq); /* Accept the input from user */ printf("\nPlease enter response:"); scanf("%",sRes); but the... (4 Replies)
Discussion started by: AAKhan
4 Replies

6. UNIX for Dummies Questions & Answers

Using Shell Script To Loop Program Through Multiple Text Files

Hello, So I have approximately 300 files of raw data (.txt) files that I am using to perform statistical analysis. I have been able to construct a Fortran program that is able to perform my statistical analysis on a file by file basis. However, I now want to be able to loop program through... (19 Replies)
Discussion started by: Jimmyd24
19 Replies

7. Programming

C program multiple definition error during linking time

Hi, I have the following files: // file.hvoid foo(); int i = 5; // should be just declared as extern int i; // file1.c#include <stdio.h> #include "file.h" void foo() { i = 10; printf("%d\n", i); } // file2.c#include <stdio.h> #include "file.h" int main() { foo(); (9 Replies)
Discussion started by: royalibrahim
9 Replies

8. Shell Programming and Scripting

Passing multiple C program output into a shell

Hi I have the following C code # cat test.c #include <stdio.h> main() { printf ("The output is : Power\n"); printf ("The output is : No Power\n"); } The output of this C code is # ./test The output is : Power The output is : No Power Now i need to pass this outputs into a shell... (4 Replies)
Discussion started by: Priya Amaresh
4 Replies

9. Shell Programming and Scripting

Shell program request

Hello, I'm requesting the shell program to compare 2 .csv files which will have large data. Can any one help me with this linux shell program Thanks in advance. Thanks and regards Ramanjaneya. K (1 Reply)
Discussion started by: pandu19
1 Replies

10. Shell Programming and Scripting

Shell program request to download .pdf files

Hello, Would you suggest me a shell program that would launch the given url and if there is login we have enter the credentials. If the credentials are correct it would be redirected to home page of that url, the program will check if there are any PDF'S found automatically the PDF'S have... (5 Replies)
Discussion started by: pandu19
5 Replies
CPANPLUS::Shell(3pm)					 Perl Programmers Reference Guide				      CPANPLUS::Shell(3pm)

NAME
CPANPLUS::Shell - base class for CPANPLUS shells SYNOPSIS
use CPANPLUS::Shell; # load the shell indicated by your # config -- defaults to # CPANPLUS::Shell::Default use CPANPLUS::Shell qw[Classic] # load CPANPLUS::Shell::Classic; my $ui = CPANPLUS::Shell->new(); my $name = $ui->which; # Find out what shell you loaded $ui->shell; # run the ui shell DESCRIPTION
This module is the generic loading (and base class) for all "CPANPLUS" shells. Through this module you can load any installed "CPANPLUS" shell. Just about all the functionality is provided by the shell that you have loaded, and not by this class (which merely functions as a generic loading class), so please consult the documentation of your shell of choice. BUG REPORTS
Please report bugs or other issues to <bug-cpanplus@rt.cpan.org<gt>. AUTHOR
This module by Jos Boumans <kane@cpan.org>. COPYRIGHT
The CPAN++ interface (of which this module is a part of) is copyright (c) 2001 - 2007, Jos Boumans <kane@cpan.org>. All rights reserved. This library is free software; you may redistribute and/or modify it under the same terms as Perl itself. SEE ALSO
CPANPLUS::Shell::Default, CPANPLUS::Shell::Classic, cpanp perl v5.18.2 2014-01-06 CPANPLUS::Shell(3pm)
All times are GMT -4. The time now is 09:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy