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
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
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
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
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
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
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
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
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
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
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
alert(3alleg4) Allegro manual alert(3alleg4)
NAME
alert - Displays a popup alert box. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
int alert(const char *s1, *s2, *s3, const char *b1, *b2, int c1, c2);
DESCRIPTION
Displays a popup alert box, containing three lines of text (s1-s3), and with either one or two buttons. The text for these buttons is
passed in `b1' and `b2' (`b2' may be NULL), and the keyboard shortcuts in `c1' and `c2' as ASCII value. Example:
if (!exists(CONFIG_FILE))
alert(CONFIG_FILE, "not found.", "Using defaults.",
"&Continue", NULL, 'c', 0);
RETURN VALUE
Returns 1 or 2 depending on which button was clicked. If the alert is dismissed by pressing ESC when ESC is not one of the keyboard short-
cuts, it treats it as a click on the second button (this is consistent with the common "Ok", "Cancel" alert).
SEE ALSO
alert3(3alleg4), gui_fg_color(3alleg4), exgui(3alleg4), expackf(3alleg4), exspline(3alleg4)
Allegro version 4.4.2 alert(3alleg4)