Re: Script question

2017-05-17 Thread Heinz Flemming
According to rou...@univ.haifa.ac.il
> Hi All
>
> Need a little help with this script
>
> select cast(node_name as varchar(20)) as "Nodebane" , cast(TCP_ADDRESS as 
> varchar(15)) as "IP" ,  cast(CLIENT_OS_NAME as varchar(35)) as " OS Name"   , 
> cast(CLIENT_SYSTEM_ARCHITECTURE as varchar(4)) as "BIT" , 
> cast(APPLICATION_VERSION as varchar(2)) as "Aooplcation Version", 
> cast(APPLICATION_RELEASE as varchar(2)) as "Applcation Release", 
> cast(APPLICATION_LEVEL as varchar(2)) as "Application Level" , 
> cast(APPLICATION_SUBLEVEL as varchar(2)) as "Application Sublevel" from nodes 
>  where (node_name like ('%%_DB')  and node_name not like ('DRM%%')) order by 4
>

Try the following:

select node_name from nodes where node_name like '%\_SQL' escape '\'

The character "_" matches excactly one character.
Therefore you must escaped it.


Heinz

--
Karlsruher Institut fuer Technologie (KIT)
Steinbuch Centre for Computing (SCC)

Heinz Flemming
Scientific Data Management (SDM)

76131 Karlsruhe

KIT - Die Forschungsuniversitaet in der Helmholtz-Gemeinschaft
--


Script question

2017-05-17 Thread rou...@univ.haifa.ac.il
Hi All

Need a little help with this script

select cast(node_name as varchar(20)) as "Nodebane" , cast(TCP_ADDRESS as 
varchar(15)) as "IP" ,  cast(CLIENT_OS_NAME as varchar(35)) as " OS Name"   , 
cast(CLIENT_SYSTEM_ARCHITECTURE as varchar(4)) as "BIT" , 
cast(APPLICATION_VERSION as varchar(2)) as "Aooplcation Version", 
cast(APPLICATION_RELEASE as varchar(2)) as "Applcation Release", 
cast(APPLICATION_LEVEL as varchar(2)) as "Application Level" , 
cast(APPLICATION_SUBLEVEL as varchar(2)) as "Application Sublevel" from nodes  
where (node_name like ('%%_DB')  and node_name not like ('DRM%%')) order by 4

Got output:

NodenaneIP  
 OS Name BIT  
Application Version  Application Release  Application Level  
Application Sublevel
-  
  
-   --- 
--   -
HPLDB  132.74.1.210
AIX:AIX  PPC
EXCHSRVAN_DB  132.74.1.226WIN:Windows 
Server 2008 R2  x647
 1 4
0
EXCHSRVBN_DB  132.74.1.227 WIN:Windows 
Server 2008 R2  x647
 1 4
0

Why the line:HPLDB appears !!

I specific node_name like(‘%%_DB’)   ?

Ideas ???

Best Regards

Robert


[cid:image001.png@01D1284F.C3B0B400]

רוברט אוזן
ראש תחום שרידות וזמינות נתונים.
אוניברסיטת חיפה
משרד: בניין ראשי, חדר 5015
טלפון:  04-8240345 (פנימי: 2345)
דואר: rou...@univ.haifa.ac.il
_
אוניברסיטת חיפה | שד' אבא חושי 199 | הר הכרמל, חיפה | מיקוד: 3498838
אתר אגף מחשוב ומערכות מידע: 
http://computing.haifa.ac.il


Re: Script question

2015-09-08 Thread Robert Ouzen
Sorry I did not mention the operating system ... for Windows 2008 R2 TSM server

Regards

Robert

-Original Message-
From: ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] On Behalf Of 
Rhodes, Richard L.
Sent: Tuesday, September 08, 2015 2:06 PM
To: ADSM-L@VM.MARIST.EDU
Subject: Re: [ADSM-L] Script question

You didn't indicate which operating system.
Here is a AIX/KSH script to prompt for and change a node password.

#!/usr/bin/ksh

print ""
print "Dialog to change a NODE password."
print ""
print "Please enter a node name, or partial node name.  I'll do a lookup on it 
for you!"
read Inode
print ""
print "You entered $Inode , performing lookukp . . . "
/tsmdata/tsm_scripts/q_node.ksh $Inode
print ""
print "There, it should be one of the above. "
print "Please enter the FULL NODE NAME from above."
Inode=""
read Inode
print ""
print "The node we are going to change is $Inode"
print ""
print "Please enter the TSM instance of the node."
read Itsm
print ""
print "The node is in  $Itsm"
print ""
print "Please enter the new password."
read Ipwd
print ""
print "TODO: chg pwd for  node= $Inode  tsm= $Itsm  newpwd= $Ipwd"
print "type \"ok\" to proceed"
read Iok
if [[ $Iok == 'ok' ]]; then
print ""
print "performing change . . . "
/tsmdata/tsm_scripts/run_cmd.ksh $Itsm "update node $Inode $Ipwd"
print ""
    print "all done"
else
print ""
print "terminating"
fi




-Original Message-
From: ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] On Behalf Of Robert 
Ouzen
Sent: Monday, September 07, 2015 9:48 PM
To: ADSM-L@VM.MARIST.EDU
Subject: Script question

Hi to all

Anybody have an example for during a script , asking for a parameter. Waiting 
for the input and after pass the parameter to a command

For example something like this:

"Please enter the process number   $1 "
Waiting ...
can pr   $1

Best Regards

Robert


-

The information contained in this message is intended only for the personal and 
confidential use of the recipient(s) named above. If the reader of this message 
is not the intended recipient or an agent responsible for delivering it to the 
intended recipient, you are hereby notified that you have received this 
document in error and that any review, dissemination, distribution, or copying 
of this message is strictly prohibited. If you have received this communication 
in error, please notify us immediately, and delete the original message.


Re: Script question

2015-09-08 Thread Meunier, Yann
Hi,

This is an example.
This script can to connect on any TSM instance available in you dsm.sys

#
#!/bin/ksh
#
# Philippe VEGA le 29 decembre 2011
#
# Menu d'affichage des connexions aux instances TSM
# utilise la fonction ListInstance pour recuperer la liste des instances TSM 
reconnues
#
# creation le 29-12-2011 pour gestion du menu d'affichage des instances TSM
# modification le 12-05-2014 demande du user / password TSM
#
set +x
#
#  definition du chemin d'acces aux fonctions du scripts et chargement
#
FPATH=/datsm/batch/commun/functions
autoload ListInstance
#
#  chargement des variables d'environnement communes et necessaires au scripts
#
. /datsm/batch/commun/env/TSM-BAC.env# variables d'acces aux 
binaires et configuration TSM
#
clear
#
# appel de la fonction de recuperartion de la liste des instances TSM definies
#
ListInstance
#
#
# Sorties en cas d'erreur
function OUT
{
 echo "\n$reve%%%-ERREUR-%%%$norm :$bold Aucune saisie, variable vide $norm"
 echo "$reve%%%-INFOS-$norm :$bold Vous devez saisir votre variable $norm\n"
 exit
}

bold=`tput bold`
reve=`tput rev`
norm=`tput sgr0`

print " $bold ===> Entrez votre nom d'utilisateur (Ex : ymeunier) $norm : \c" ; 
read TSM_ID
[[ $TSM_ID = "" ]] && OUT  # Si pas de saisi on sort
stty -echo ; print " $bold ===> Entrez votre mot de passe : $norm : \c" ; read 
TSM_PWD ; stty echo
[[ $TSM_PWD = "" ]] && OUT  # Si pas de saisi on sort
print "\n"
cpt_erreur=0

clear

set -A TSMinstance ${INSTANCE} "Sortie"
#echo ${TSMinstance[0]}
#
set +x
while [[ $choix != "Sortie" ]]
  do
  print 'Selectionnez votre instance TSM:'
  PS3='choix? '
  select choix in ${TSMinstance[*]}
  do
  if [[ -n $choix && $choix != "Sortie" 
]]
then

instance=${TSMinstance[REPLY-1]}
  dsmadmc -se=$instance 
-id=${TSM_ID} -pa=${TSM_PWD} $1;
  read
  clear
  break
else
  break
fi
 done
 done
#
set +x
#
# fin
#

Best Regards,

Yann MEUNIER
Ingénierie - Système Stockage
Informatique CDC - Etablissement DPI
Office : +33 1 58 50 53 01
Mobile : +33 6 62 47 88 56


-Message d'origine-
De : ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] De la part de Robert 
Ouzen
Envoyé : mardi 8 septembre 2015 03:48
À : ADSM-L@VM.MARIST.EDU
Objet : [ADSM-L] Script question

Hi to all

Anybody have an example for during a script , asking for a parameter. Waiting 
for the input and after pass the parameter to a command

For example something like this:

“Please enter the process number   $1 “
Waiting ………..
can pr   $1

Best Regards

Robert
Ce message et toutes les pièces jointes (ci-après le « message ») sont 
confidentiels et établis à l’intention exclusive de ses destinataires. Toute 
utilisation de ce message non conforme à sa destination, toute diffusion ou 
toute publication, totale ou partielle, est interdite, sauf autorisation 
expresse. Si vous recevez ce message par erreur, merci de le détruire sans en 
conserver de copie et d’en avertir immédiatement l’expéditeur. Internet ne 
permettant pas de garantir l’intégrité de ce message, la Caisse des Dépôts et 
Consignations décline toute responsabilité au titre de ce message s’il a été 
modifié, altéré, déformé ou falsifié. Par ailleurs et malgré toutes les 
précautions prises pour éviter la présence de virus dans nos envois, nous vous 
recommandons de prendre, de votre côté, les mesures permettant d'assurer la 
non-introduction de virus dans votre système informatique.

This email message and any attachments (“the email”) are confidential and 
intended only for the recipient(s) indicated. If you are not an intented 
recipient, please be advised that any use, dissemination, forwarding or copying 
of this email whatsoever is prohibited without Caisse des Depots et 
Consignations's prior written consent. If you have received this email in 
error, please delete it without saving a copy and notify the sender 
immediately. Internet emails are not necessarily secured, and declines 
responsibility for any changes that may have been made to this email after it 
was sent. While we take all reasonable precautions to ensure that viruses are 
not transmitted via emails, we recommend that you take your own measures to 
prevent viruses from entering your computer system.



Re: Script question

2015-09-08 Thread Meunier, Yann
Hi Robert,

This is an example with Powershell :

$a = read-host "what is your name?"
"hello $a"

For secure (password ..) you can add this parameter : -AsSecureString

$pass = Read-Host 'What is your password?' -AsSecureString

Best Regards,

Yann MEUNIER
Ingénierie - Système Stockage
Informatique CDC - Etablissement DPI
Office : +33 1 58 50 53 01
Mobile : +33 6 62 47 88 56



-Message d'origine-
De : ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] De la part de Robert 
Ouzen
Envoyé : mardi 8 septembre 2015 14:04
À : ADSM-L@VM.MARIST.EDU
Objet : Re: [ADSM-L] Script question

Sorry I did not mention the operating system ... for Windows 2008 R2 TSM server

Regards

Robert

-Original Message-
From: ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] On Behalf Of 
Rhodes, Richard L.
Sent: Tuesday, September 08, 2015 2:06 PM
To: ADSM-L@VM.MARIST.EDU
Subject: Re: [ADSM-L] Script question

You didn't indicate which operating system.
Here is a AIX/KSH script to prompt for and change a node password.

#!/usr/bin/ksh

print ""
print "Dialog to change a NODE password."
print ""
print "Please enter a node name, or partial node name.  I'll do a lookup on it 
for you!"
read Inode
print ""
print "You entered $Inode , performing lookukp . . . "
/tsmdata/tsm_scripts/q_node.ksh $Inode
print ""
print "There, it should be one of the above. "
print "Please enter the FULL NODE NAME from above."
Inode=""
read Inode
print ""
print "The node we are going to change is $Inode"
print ""
print "Please enter the TSM instance of the node."
read Itsm
print ""
print "The node is in  $Itsm"
print ""
print "Please enter the new password."
read Ipwd
print ""
print "TODO: chg pwd for  node= $Inode  tsm= $Itsm  newpwd= $Ipwd"
print "type \"ok\" to proceed"
read Iok
if [[ $Iok == 'ok' ]]; then
print ""
print "performing change . . . "
/tsmdata/tsm_scripts/run_cmd.ksh $Itsm "update node $Inode $Ipwd"
print ""
print "all done"
else
print ""
print "terminating"
fi




-Original Message-
From: ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] On Behalf Of Robert 
Ouzen
Sent: Monday, September 07, 2015 9:48 PM
To: ADSM-L@VM.MARIST.EDU
Subject: Script question

Hi to all

Anybody have an example for during a script , asking for a parameter. Waiting 
for the input and after pass the parameter to a command

For example something like this:

"Please enter the process number   $1 "
Waiting ...
can pr   $1

Best Regards

Robert


-

The information contained in this message is intended only for the personal and 
confidential use of the recipient(s) named above. If the reader of this message 
is not the intended recipient or an agent responsible for delivering it to the 
intended recipient, you are hereby notified that you have received this 
document in error and that any review, dissemination, distribution, or copying 
of this message is strictly prohibited. If you have received this communication 
in error, please notify us immediately, and delete the original message.
Ce message et toutes les pièces jointes (ci-après le « message ») sont 
confidentiels et établis à l’intention exclusive de ses destinataires. Toute 
utilisation de ce message non conforme à sa destination, toute diffusion ou 
toute publication, totale ou partielle, est interdite, sauf autorisation 
expresse. Si vous recevez ce message par erreur, merci de le détruire sans en 
conserver de copie et d’en avertir immédiatement l’expéditeur. Internet ne 
permettant pas de garantir l’intégrité de ce message, la Caisse des Dépôts et 
Consignations décline toute responsabilité au titre de ce message s’il a été 
modifié, altéré, déformé ou falsifié. Par ailleurs et malgré toutes les 
précautions prises pour éviter la présence de virus dans nos envois, nous vous 
recommandons de prendre, de votre côté, les mesures permettant d'assurer la 
non-introduction de virus dans votre système informatique.

This email message and any attachments (“the email”) are confidential and 
intended only for the recipient(s) indicated. If you are not an intented 
recipient, please be advised that any use, dissemination, forwarding or copying 
of this email whatsoever is prohibited without Caisse des Depots et 
Consignations's prior written consent. If you have received this email in 
error, please delete it without saving a copy and notify the sender 
immediately. Internet emails are not necessarily secured, and declines 
responsibility for any changes that may have been made to this email after it 
was sent. While we take all reasonable precautions to ensure that viruses are 
not transmitted via emails, we recommend that you take your own measures to 
prevent viruses from entering your computer system.



Re: Script question

2015-09-08 Thread Rhodes, Richard L.
You didn't indicate which operating system.
Here is a AIX/KSH script to prompt for and change a node password.

#!/usr/bin/ksh

print ""
print "Dialog to change a NODE password."
print ""
print "Please enter a node name, or partial node name.  I'll do a lookup on it 
for you!"
read Inode
print ""
print "You entered $Inode , performing lookukp . . . "
/tsmdata/tsm_scripts/q_node.ksh $Inode
print ""
print "There, it should be one of the above. "
print "Please enter the FULL NODE NAME from above."
Inode=""
read Inode
print ""
print "The node we are going to change is $Inode"
print ""
print "Please enter the TSM instance of the node."
read Itsm
print ""
print "The node is in  $Itsm"
print ""
print "Please enter the new password."
read Ipwd
print ""
print "TODO: chg pwd for  node= $Inode  tsm= $Itsm  newpwd= $Ipwd"
print "type \"ok\" to proceed"
read Iok
if [[ $Iok == 'ok' ]]; then
print ""
print "performing change . . . "
/tsmdata/tsm_scripts/run_cmd.ksh $Itsm "update node $Inode $Ipwd"
print ""
    print "all done"
else
print ""
print "terminating"
fi




-Original Message-
From: ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] On Behalf Of Robert 
Ouzen
Sent: Monday, September 07, 2015 9:48 PM
To: ADSM-L@VM.MARIST.EDU
Subject: Script question

Hi to all

Anybody have an example for during a script , asking for a parameter. Waiting 
for the input and after pass the parameter to a command

For example something like this:

"Please enter the process number   $1 "
Waiting ...
can pr   $1

Best Regards

Robert


-
The information contained in this message is intended only for the personal and 
confidential use of the recipient(s) named above. If the reader of this message 
is not the intended recipient or an agent responsible for delivering it to the 
intended recipient, you are hereby notified that you have received this 
document in error and that any review, dissemination, distribution, or copying 
of this message is strictly prohibited. If you have received this communication 
in error, please notify us immediately, and delete the original message.


Script question

2015-09-07 Thread Robert Ouzen
Hi to all

Anybody have an example for during a script , asking for a parameter. Waiting 
for the input and after pass the parameter to a command

For example something like this:

“Please enter the process number   $1 “
Waiting ………..
can pr   $1

Best Regards

Robert


Tape return script question?

2005-07-05 Thread Joni Moyer
Hello,

I have created this script to create a request listing of tapes to be
returned from our vault when they are empty.  As you can see from the
select statement that I run daily it will have duplicates within it since I
have a delay of 5 days.  Is there a certain way I can manipulate this
script so that on the 1st day that a tape becomes pending it is placed
within this listing?  Or is there an easier way to create this list?
Thanks in advance for your help!

select volume_name from volumes where stgpool_name='TAPE_NDMP_OFFSITE' and
devclass_name='NASDEV' and status='PENDING' or status='EMPTY' and
volume_name like 'N%' order by volume_name

Joni Moyer
Highmark
Storage Systems
Work:(717)302-6603
Fax:(717)302-5974
[EMAIL PROTECTED]



Re: Tape return script question?

2005-07-05 Thread Warren, Matthew (Retail)
Hi, 

I'm not sure I follow what your after, but you may be able to alter this
script to get the desired effect,

http://www.tsmwiki.com/tsmwiki/SelectStatements/ReclaimableByDays

That script runs several queries to show how many volumes went pending
by stgpool by day. Adding in the extra clauses you have in your
statement, you may be able to show what your after.

I would try and make the script.. but it's 17:00pm and I have a bus to
catch!!


Matthew Warren.


-Original Message-
From: ADSM: Dist Stor Manager [mailto:[EMAIL PROTECTED] On Behalf Of
Joni Moyer
Sent: Tuesday, July 05, 2005 2:50 PM
To: ADSM-L@VM.MARIST.EDU
Subject: Tape return script question?

Hello,

I have created this script to create a request listing of tapes to be
returned from our vault when they are empty.  As you can see from the
select statement that I run daily it will have duplicates within it
since I
have a delay of 5 days.  Is there a certain way I can manipulate this
script so that on the 1st day that a tape becomes pending it is placed
within this listing?  Or is there an easier way to create this list?
Thanks in advance for your help!

select volume_name from volumes where stgpool_name='TAPE_NDMP_OFFSITE'
and
devclass_name='NASDEV' and status='PENDING' or status='EMPTY' and
volume_name like 'N%' order by volume_name

Joni Moyer
Highmark
Storage Systems
Work:(717)302-6603
Fax:(717)302-5974
[EMAIL PROTECTED]




___ Disclaimer Notice __
This message and any attachments are confidential and should only be read by 
those to whom they are addressed. If you are not the intended recipient, please 
contact us, delete the message from your computer and destroy any copies. Any 
distribution or copying without our prior permission is prohibited.

Internet communications are not always secure and therefore Powergen Retail 
Limited does not accept legal responsibility for this message. The recipient is 
responsible for verifying its authenticity before acting on the contents. Any 
views or opinions presented are solely those of the author and do not 
necessarily represent those of Powergen Retail Limited. 

Powergen Retail Ltd is authorised and regulated by the Financial Services 
Authority for the sale and service of general insurance products.

Registered addresses:

Powergen Retail Limited, Westwood Way, Westwood Business Park, Coventry, CV4 
8LG.
Registered in England and Wales No: 3407430

Telephone +44 (0) 2476 42 4000
Fax +44 (0) 2476 42 5432


Script question

2002-07-09 Thread Stephen A. Cochran

Hopefully a simple question:

I have a select script that finds the tapes I want to be processed by
MOV DRM, is there a way to pipe the results from the select back into
that command? Here's the select:

select volume_name,state from drmedia where (volume_name in (select
volume_name from volumes where status='FULL') and state='MOUNTABLE') or
volume_name in (select volume_name from libvolumes where
last_use='DbBackup')

And I want the volumes returned from that to be processed by MOV DRM.

The other option would be outputting to a tmp file and creating a
command for each volume, but that seems more complicated than it should
be.

Steve Cochran
Dartmouth College



Re: Script question

2002-07-09 Thread Miles Purdy

In order to find a list of tapes to remove from my LTO every morning, and update their 
DRM status, I use a script. Here is the relevant code. The actual script is much 
longer and does several things. My script will creates another KSH script.

Code:

CHECKOUT=/tmp/update_checkout_status.`date +%d%b%Y`
OUTPUT_FILE=/tmp/tapes_to_remove.`date +%d%b%Y`
dsmadmc -id=query -password=query q actlog begint=08:00 endt=08:40 | grep -i from 
slot | sed s/  / /g | sed s/  / /g | sort -t  +9 -n   $OUTPUT_FILE
cat $OUTPUT_FILE | sed s/^/echo /
   
   $CHECKOUT.1
cat $OUTPUT_FILE | cut -f 7 -d   | sort | sed s/^/dsmadmc -id=\$ID 
-password=\$PASSWORD move drmedia / 
$CHECKOUT.2
cat $CHECKOUT.2 | sed s/$/ tostate=vault | grep -i return/   
   
   $CHECKOUT.3
cat $CHECKOUT.1 $CHECKOUT.3
   
   $CHECKOUT

The idea is to parse the actlog. Find the cartridges names, then add 'move drmedia' 
and 'tostate=vault' around the cartridge name.

Miles


--
Miles Purdy 
System Manager
Farm Income Programs Directorate
Winnipeg, MB, CA
[EMAIL PROTECTED]
ph: (204) 984-1602 fax: (204) 983-7557

If you hold a UNIX shell up to your ear, can you hear the C?
-

 [EMAIL PROTECTED] 09-Jul-02 10:00:16 AM 
Hopefully a simple question:

I have a select script that finds the tapes I want to be processed by
MOV DRM, is there a way to pipe the results from the select back into
that command? Here's the select:

select volume_name,state from drmedia where (volume_name in (select
volume_name from volumes where status='FULL') and state='MOUNTABLE') or
volume_name in (select volume_name from libvolumes where
last_use='DbBackup')

And I want the volumes returned from that to be processed by MOV DRM.

The other option would be outputting to a tmp file and creating a
command for each volume, but that seems more complicated than it should
be.

Steve Cochran
Dartmouth College



Script Question

2001-06-03 Thread Robert Ouzen

I run a Tivoli backup server version 3.7.4.0 on an AIX-RS/6000.
My question is anyone create a script or a macro doing like:

Migration from diskpool to tapepool checking the %Utilized = 0 ( or checking the query 
process with no migration) then doing another command as Expire inventory then 
checking the process and when finish doing like a backup db.

T.I.A Robert