Contact Info

Crumbtrail

ActiveXperts.com » Network Monitor » Scripts » Custom Script

weekend.sh - ssh script by ActiveXperts Software

weekend.sh checks which day it is.

Use weekend.sh directly from ActiveXperts Network Monitor; in the Manager's 'Monitor' menu, select 'New Check (Script)' and select weekend.sh. Configure the required parameter, or press 'Load a working sample'.

In ActiveXperts Network Monitor, Administrators can use three different scripting languages: Powershell, VBScript and SSH.


weekend.sh script code

#################################################################################
# ActiveXperts Network Monitor - Shell script checks
# © 1999-2015, ActiveXperts Software B.V.
#
# For more information about ActiveXperts Network Monitor and SSH, please
# visit the online ActiveXperts Network Monitor Shell Script Guidelines at:
#   http://www.activexperts.com/support/network-monitor/online/linux/
#################################################################################
# Script
#     weekend.sh
# Description
#     Checks which day it is. This code can be used in combination with other scripts
#     to check on specified days
# Declare Parameters
#     None
# Usage
#     weekend.sh
# Sample
#     weekend.sh
#################################################################################

#!/bin/sh

# Validate number of arguments
if [ $# -ne 0 ] ; then
  echo "UNCERTAIN: Invalid number of arguments - Usage: weekend"
  exit 1
fi

#Checks the day in the system
case $(date "+%a") in
  Mon|Tue|Wed|Thu|Fri)   
  echo "ERROR: It's a normal working day DATA:0" ;;
  *)
  echo "SUCCESS: It's weekend  DATA:1" ;;
esac