Sponsored Content
Full Discussion: Implicit Ping
Top Forums Shell Programming and Scripting Implicit Ping Post 57979 by izy100 on Thursday 11th of November 2004 10:40:18 AM
Old 11-11-2004
One of the best way is to do a rsh to the client.
Pinging -> Does not eliminate the possibility that the server id down at ok promp but network is alive.

If you have security concern regarding rsh, you can use ftp to do that.

You can check use .netrc to search google on how to automate ftp or look at my monitoring script below...

#!/bin/ksh
#
# Created: Steven Koh on Apr 1st 2004
# Last Amended: Steven Koh on Apr 1st 2004
# Last checked: Steven Koh on xxx
#
# Solaris Monitor Ftp Script
# Purpose: Monitors servers via use of the ftp command
# and notifies via email.
# Usage: Execute from crontab every 15 minutes.
# Dependencies: $HOME/.netrc
# Outputs: E-mail, SNMP
#***************************************************

CONF_FILE=/usr/local/scripts/monitor.conf

SCRIPTDIR=`grep "SCRIPTDIR" $CONF_FILE | awk -F= '{print $NF}'`

# The directory this script resides in
ADMINDIR=$SCRIPTDIR/monitorFTP

MAILADD=$LOGNAME@localhost
SMS_LIST=$HOME/sms.List

# Define the hostname of the server
SRVNM=`uname -n`

# Define the hostname of the SNMP server
SNMP_SRV=`grep "SNMP_SRV" $CONF_FILE | awk -F= '{print $NF}'`
SEND_TRAP=`grep "SEND_TRAP" $CONF_FILE | awk -F= '{print $NF}'`
SEND_SMS=`grep "SEND_SMS" $CONF_FILE | awk -F= '{print $NF}'`

touch ftp.test
grep machine $HOME/.netrc | awk '{print $2}' > $HOME/mon_ftp.dat

grep -v "#" $HOME/mon_ftp.dat |
while read -r SRVNM
do
echo "put ftp.test" | ftp $SRVNM

if test `echo "ls ftp.test" | ftp $SRVNM | grep -v "No such file or directory" | grep -c ftp.test` -ne
1; then

echo "Unable to FTP to $SRVNM"

# Wait 1 min before checking again
sleep 60

if test `echo "ls ftp.test" | ftp $SRVNM | grep -v "No such file or directory" | grep -c ftp.test` -
ne 1; then

echo "Unable to FTP to $SRVNM"

mail $MAILADD <<EOF
From: $0
To: $MAILADD
Subject: Unable to FTP to $SRVNM

Unable to FTP to $SRVNM

EOF

# Sending SMS
$SEND_SMS $SMS_LIST "FTP001_$SRVNM: Unable to FTP to $SRVNM. Check if network/ftp is down"

fi
fi

done
exit 0
 

10 More Discussions You Might Find Interesting

1. Programming

gcc warnings: implicit declaration of function...

I am having strange warnings from gcc compiler, which I don't think should come while cmpiling. Can anyone help? The warnings are: - warning: implicit declaration of function 'bzero' - warning: implicit declaration of function 'inet_addr' The code is as below: int main(int argc, char... (2 Replies)
Discussion started by: Ahsan
2 Replies

2. AIX

Implicit login in AIX

only wanted to know .. if I have some tivoli jobs running with different user .. will this mean that everytime the job invokes .. the .profile runs for that user ... or is it that the .profile runs only at explicit LOGINs ... e.g if a cron calls a job under some user, does it run the .profile of... (1 Reply)
Discussion started by: rajesh_149
1 Replies

3. Shell Programming and Scripting

FTP/implicit SSL

Hi, I want to FTP can some one help me how do I do this manually from unix command line Thanks, (2 Replies)
Discussion started by: sridatos
2 Replies

4. Programming

implicit declaration of function 'reboot'

Hi, I'm tying to use the following function to reboot the system as part of my code #include <unistd.h> #include <linux/reboot.h> int restart(unsigned int delay) { sleep(delay); return reboot(LINUX_REBOOT_CMD_RESTART); } When I try to compile the code I get the warning in the... (2 Replies)
Discussion started by: galapogos
2 Replies

5. UNIX for Dummies Questions & Answers

Automating ftp job using implicit ssl?

Can this be done? Or do you need some other program installed on the AIX box? (6 Replies)
Discussion started by: NycUnxer
6 Replies

6. SuSE

RPM implicit dependencies

Hi, I'm having issues with implicit dependencies for my RPM package. This is the error I'm getting: error: Failed dependencies: libclntsh.so.11.1()(64bit) is needed by geomatica-10.4-0.x86_64 Our software has a dynamically loaded library which links to the Oracle's libclntsh.so.11.1... (2 Replies)
Discussion started by: pneveu
2 Replies

7. UNIX for Dummies Questions & Answers

FTP over implicit TSL - for dummies

Here are the essentials: un: myuser pw: mypasswd site: sftp.somesite.com port: 990 type: FTPS enc: FTP over implicit TLS program used: Curl 7.1.x on Hpux 11.31 I would like to "put" 1 file on there server. Here is my syntax, what am I doing wrong? curl -3 -v --cacert... (5 Replies)
Discussion started by: olyanderson
5 Replies

8. UNIX for Advanced & Expert Users

FTP over implicit TLS

Here are the essentials: un: myuser pw: mypasswd site: sftp.somesite.com port: 990 type: FTPS enc: FTP over implicit TLS program used: Curl 7.1.x on Hpux 11.31 I would like to "put" 1 file on there server. Here is my syntax, what am I doing wrong? curl -3 -v --cacert... (4 Replies)
Discussion started by: olyanderson
4 Replies

9. Shell Programming and Scripting

Implicit FTPS error on Citrix Sharefile

Hi, I have to upload a file to a remote Citrix Sharefile server using implicit FTPS. But the problem I'm facing is that when the FTPS UNIX script is called through a GUI tool; it keeps on running and after forcibly killing that job, if I try to connect the same server directly from the UNIX box... (1 Reply)
Discussion started by: dips_ag
1 Replies

10. Programming

Ping test sends mail when ping fails

help with bash script! im am working on this script to make sure my server will stay online, so i made this script.. HOSTS="192.168.138.155" COUNT=4 pingtest(){ for myhost in "$@" do ping -c "$COUNT" "$myhost" &&return 1 done return 0 } if pingtest $HOSTS #100% failed... (4 Replies)
Discussion started by: mort3924
4 Replies
INSTALLSIEVE(1) 					      General Commands Manual						   INSTALLSIEVE(1)

 *

NAME
installsieve - user utility for managing sieve scripts SYNOPSIS
installsieve DESCRIPTION
installsieve is a utility that allows users to manage their sieve scripts kept on the server. OPTIONS
-v <name> View script with the given name. The script if retrieved sucessfully is output to standard output. -l List all of the scripts currently on the server. If one of the scripts is active a arrow is printed indicating that it is the active script. -p <port> Port to connect to. If left off this defaults to "sieve" as defined in /etc/services. -i <file> Install a file onto the server. If a script with the same name already exists on the server it is overwritten. Upon sucessfully putting the script on the server the script is set active. If <file> has the extension .script it is chopped when put on the server since sieve names may not contain a '.'. -a <name> Set <name> as the active script. The list of available names can be obtained from the '-l' option.. -d <name> Delete the sieve script on the server with <name>. -m <mechanism> Force installsieve to use <mechanism> for authentication. If not specified the strongest authentication mechanism is chosen. -g <name> Get the sieve script with <name> and save it to disk with a ".script" extension. If a file with that name already exists it is overwritten. -u <user> Userid/Authname to use for authentication; by default, the current user. CMU
Project Cyrus INSTALLSIEVE(1)
All times are GMT -4. The time now is 03:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy