Tag Archives: EMAIL

Logging in to multiple Linux servers and running the command.

By jpkumar10

Hi,

I am trying to write a script to run a command on multiple linux based servers and get the o/p. I am using ssh to login. It is a celerra box and EMC NAS product.
I am able login but i am not able to run nas command nas_pool -size -all the NAS server. I am getting the following error.

Code:

bash: /nas/sbin/nas_pool: No such file or directory


here is my code. I have added the directory where the command or found but still the bash is not able to run the command. I tired with #!/bin/bash and #!/bin/sh none of the shell are working here is the code that I am running.

Code:

#!/bin/sh
# Linux/UNIX box with ssh key based login
SERVERS="192.168.1.1" ## I have changed the ip addresses for security reason.
# SSH User name
USR="nasadmin"

# Email
SUBJECT="Server user login report"
EMAIL="abcdefgh@gmail.com"
EMAILMESSAGE="/tmp/emailmessage.txt"

# create new file
>$EMAILMESSAGE

# connect each host and pull up user listing
for host in $SERVERS
do
echo "--------------------------------" >>$EMAILMESSAGE
echo "* HOST: $host capacity report " >>$EMAILMESSAGE
echo "--------------------------------" >>$EMAILMESSAGE
echo "for host $host "
ssh $USR@$host /nas/sbin/nas_pool -size -all >> $EMAILMESSAGE
done

# send an email using /bin/mail
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE


I am not sure what I am missing. EMC Celerra is a propitiatory LINUX. I did get the o/p for pwd command. I am not sure why /nas/sbin/nas_pool -size -list is not working.

Any help is greatly appreciated.

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Version of OpenSSL being used

By CHoggarth

Hello

I’m relatively new to technologies like Apache & ssl but have some years
experience with Unix. My question concerns the version of OpenSSL which is
genuinely being used on our server & how is that set.

The server is running Solaris 10. I’ll show output from various commands:

Code:

:/usr/local/ssl # pkginfo -l SMCossl
PKGINST: SMCossl
NAME: openssl
CATEGORY: application
ARCH: sparc
VERSION: 1.0.1c
BASEDIR: /usr/local
VENDOR: The OpenSSL Group
PSTAMP: Steve Christensen
INSTDATE: Aug 17 2012 07:27
EMAIL: steve@smc.vnet.net
STATUS: completely installed
FILES: 1871 installed pathnames
1 shared pathnames
43 directories
32 executables
30745 blocks used (approx)

:/usr/local/ssl #


Code:

:/usr/local/ssl # openssl version -a
OpenSSL 1.0.1c 10 May 2012
built on: Sun May 13 18:44:13 EDT 2012
platform: solaris-sparcv9-gcc
options: bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) idea(int) blowfish(ptr)
compiler: gcc -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -
DDSO_DLFCN -DHAVE_DLFCN_H -m32 -mcpu=ultrasparc -O3 -fomit-frame-
pointer -Wall -DB_ENDIAN -DBN_DIV2W -DOPENSSL_BN_ASM_MONT -DSHA1
_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DGHASH_ASM
OPENSSLDIR: "/usr/local/ssl"
:/usr/local/ssl #


But if I run telnet xxx.xxx.xxx.xxx 80 & OPTIONS / HTTP1.0 from our network it reports 0.9.8x:

Code:

HTTP/1.1 200 OK
Date: Tue, 19 Feb 2013 10:20:37 GMT
Server: Apache/2.2.23 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8x DAV/2
Allow: POST,OPTIONS,GET,HEAD
Vary: Accept-Encoding
Content-Length: 0
Connection: close
Content-Type: text/html

Connection to host lost.

W:>


I’ve been advised to use OPTIONS / HTTP1.0 to determine which version is genuinely being used.

We have in the past installed SSL by package (the most recent being 1.0.1) & source (presumably the most recent being 0.9.8x).

I need to upgrade SSL on this server & I would like to use the 1.0.1 stream (I understand packages are more likely to be available for this & that’s certainly easier to install). But I can’t figure out why the system is really using 0.9.8x when the server itself is saying that 1.0.1 is being used.

I am assuming that the OPTIONS / HTTP1.0 command is giving me the true version.

Can anyone clarify what might be happening & advise how I can start using 1.0.1?

Thanks, Chris

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Working with files that are named with a timestamp

So I have a script that runs an ls on a given directory and looks for files with a timestamp that has the current hour in it and then does work with the files that it discovers

Code:
DATE=`date +’%y%m%d%H’`
HOSTIS=`hostname`
#EMAIL NOTIFICATION ALS
EMAIL=address@server.com
#

if [ $HOSTIS = ‘serverhostname’ ]; then
TOHOST=’destination_address@destination_server.com’
else
#This is for the test server
TOHOST=’test_address@test_server.com’
fi

for i in `ls /transfer |grep $DATE`
do

sftp -vvv $TOHOST 2>&1 | tee /homedir/user/debug.out
Source: The UNIX and Linux Forums