EEM Scripting for error and drop counters

Hi,
We want to check the following counters for drops every 5 minutes and generate an alarm if a certain threshold of errors (example: increment of 100 in the error/drop counters in the last 5 minutes) is overcome:
My sample script is inline, i'm missing how to parse and generate the alarm if the threshold is surpassed:
Example command:
SPLAB_7600_3#remote command module 4 show platform hardware drops | include Selene|drp                
------ Selene 0 Channel 0 ------
Selene Ingress Drop Counters Ch[0]
Selene Egress Drop Counters Ch[0]
    egr_tot_fifo_drp_ctr                          25
Selene Drop Counters
------ Selene 1 Channel 0 ------
Selene Ingress Drop Counters Ch[0]
Selene Egress Drop Counters Ch[0]
Selene Drop Counters
Best Regards,
Afonso
::cisco::eem::event_register_timer watchdog time $check_interval nice 1
# EEM policy to monitor a internal counters
# August 2012, Cisco Systems
# Copyright (c) 2012 by cisco Systems, Inc.
# All rights reserved.
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
# 2. Execute the counter show commands
if [catch {cli_open} result] {
    error $result $errorInfo
} else {
    array set cli1 $result
if [catch {cli_exec $cli1(fd) "enable"} result] {
    error $result $errorInfo
if [catch {cli_exec $cli1(fd) "cisco"} result] {
    error $result $errorInfo
# - - - - - -  Interface error counters
if [catch {cli_exec $cli1(fd) "remote command module x show platform hardware selene np-idx 0 counters | include drop"} result] {
        error $result $errorInfo
set egr_drp_ctr $result
#- Parsing and conditional programming for the generation of traps based on the drop value extracted from the show command
action_syslog priority info msg "Counter Alarm"
#Exit
if [catch {cli_exec $cli1(fd) "end"} result] {
    error $result $errorInfo

I believe this is what you are looking for:
set egr_drp_ctr $result
expr {$egr_drp_ctr + 100} sumof
if {$egr_drp_ctr >= $sumof}
    puts "Alarm"
It may need correction on the syntax , but thats the logic.

Similar Messages

  • Auto Email on event - EEM script for NxOS

    I generated EEM script for Duplicate IP address detection, but i do not know how to trigger email in NxOS.
    event manager environment emailto "[email protected]"
    event manager applet Duplicate_IP
      description "Detect Duplicate IP and Send Trap"
      event syslog pattern "%ARP-2-DUP_SRC_IP"
      action 1.0 snmp-trap strdata "Duplicate IP Detected on Host $hostname"
      action 2.0 cli sh logg last 100
      action 3.0 event-default
    Somebody know how to trigger email. There is no good document on EEM email triggering mechanism.

    Not sure if this would work in NxOS but I think it would go something like this;
    Specify the action of sending a short e-mail when the EEM applet is triggered via the event syslog pattern you already have defined:
         Router(config-applet)#  action label mail server server-address to to-address from from-address subject subject body body-text
    Remember to define the EEM environment variables first when setting up the applet as follows:
       event manager environment  _email_server
       event manager environment  _email_to
       event manager environment  _email_from

  • Shell Script  for Startup and Shutdown the database

    Hi,
    i want Shell Script for Startup and Shutdown the database in Solaries.
    could any one can hep me where i can get this script. or send to me to [email protected]
    Thanks & Regards,
    Gangi reddy

    SHUTDOWN
    SHUTDOWN ABORT]
    Shuts down a currently running Oracle instance, optionally closing and dismounting a database.
    Terms
    Refer to the following list for a description of each term or clause:
    ABORT
    Proceeds with the fastest possible shutdown of the database without waiting for calls to complete or users to disconnect.
    Uncommitted transactions are not rolled back. Client SQL statements currently being processed are terminated. All users currently connected to the database are implicitly disconnected and the next database startup will require instance recovery.
    You must use this option if a background process terminates abnormally.
    IMMEDIATE
    Does not wait for current calls to complete or users to disconnect from the database.
    Further connects are prohibited. The database is closed and dismounted. The instance is shutdown and no instance recovery is required on the next database startup.
    NORMAL
    NORMAL is the default option which waits for users to disconnect from the database.
    Further connects are prohibited. The database is closed and dismounted. The instance is shutdown and no instance recovery is required on the next database startup.
    TRANSACTIONAL [LOCAL]
    Performs a planned shutdown of an instance while allowing active transactions to complete first. It prevents clients from losing work without requiring all users to log off.
    No client can start a new transaction on this instance. Attempting to start a new transaction results in disconnection. After completion of all transactions, any client still connected to the instance is disconnected. Now the instance shuts down just as it would if a SHUTDOWN IMMEDIATE statement was submitted. The next startup of the database will not require any instance recovery procedures.
    The LOCAL mode specifies a transactional shutdown on the local instance only, so that it only waits on local transactions to complete, not all transactions. This is useful, for example, for scheduled outage maintenance.
    Usage
    SHUTDOWN with no arguments is equivalent to SHUTDOWN NORMAL.
    You must be connected to a database as SYSOPER, or SYSDBA. You cannot connect via a multi-threaded server. For more information about connecting to a database, see the CONNECT command earlier in this chapter.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1013607
    Joel Pérez

  • I have 9.0.1 on 2 pc's, both xp sp3. On 1 the 'open new tab' button is visible, on the other, the 'open new tab' button is not even available in the 'customize toolbar' menu for dragging and dropping. Why?

    I used the same installation file, but on 1 pc, the 'open new tab' button is available in the 'customize toolbar' menu and can be dragged and dropped onto the navigation bar. On the other pc, the 'open new tab' button/icon is not even available for dragging and dropping. I uninstalled firefox completely, including settings and preferences, then reinstalled, but that did not correct the missing button.

    Hi,
    Please try '''Restore Default Set''' in the '''Customize...''' window. If it's still not visible, one reason could be that the button is already placed on the toolbar but may be hidden behind another icon or toolbar.
    Useful links:
    [https://support.mozilla.com/en-US/kb/Options%20window All about Tools > Options]
    [http://kb.mozillazine.org/About:config Going beyond Tools > Options - about:config]
    [http://kb.mozillazine.org/About:config_entries about:config Entries]
    [https://support.mozilla.com/en-US/kb/Page%20Info%20window Page Info] Tools (Alt + T) > Page Info, Right-click > View Page Info
    [https://support.mozilla.com/en-US/kb/Keyboard%20shortcuts Keyboard Shortcuts]
    [https://support.mozilla.com/en-US/kb/Viewing%20video%20in%20Firefox%20without%20a%20plugin Viewing Video without Plugins]
    [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder & Files]
    [https://developer.mozilla.org/en/Command_Line_Options#Browser Firefox Commands]
    [https://support.mozilla.com/en-US/kb/Basic%20Troubleshooting Basic Troubleshooting]
    [https://support.mozilla.com/en-US/kb/common-questions-after-upgrading-firefox-36 After Upgrading]
    [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20plugins Troubleshooting Plugins]
    [http://kb.mozillazine.org/Testing_plugins Testing Plugins]

  • [svn:fx-trunk] 10876: Add support for drag-and-drop from Spark List to Spark List.

    Revision: 10876
    Author:   [email protected]
    Date:     2009-10-05 15:20:07 -0700 (Mon, 05 Oct 2009)
    Log Message:
    Add support for drag-and-drop from Spark List to Spark List.
    - List drop related handlers
    - LayoutBase APIs
    - VerticalLayout DND support
    Notes:
    - ListSkin is not final.
    - Drag-scrolling not yet implemented.
    QE notes: Only VerticalLayout works, HorizontalLayout still not implemented.
    Doc notes: None
    Bugs: None
    Reviewer: Deepa
    Tests run: checkintests
    Is noteworthy for integration: No
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/List.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/ListSkin.mxml
        flex/sdk/trunk/frameworks/spark-manifest.xml
    Added Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/DropLocation.as

    Whoops, disregard my question - I just read the spec that indicates drag and drop is scheduled for later work.
    David

  • Need steps to create ant scripts for publishing and deploying projects.

    Need steps to create ant scripts for publishing and deploying projects.
    Have got ant, Oracle BPM Enterprise WL edition installed , Need to know what are the other configurations to be done.
    Any working example would help me to understand, please do mail me at [email protected]
    Thanks in advance.
    -Sree

    Sreekant,
    Please find the build file to publish and deploy.
    <project name="deployProject"
    xmlns:fuego="antlib:fuego.tools.ant.enterprise"
    xmlns:fuego.j2ee="antlib:fuego.tools.ant.j2ee" default = "publish">
              <property file="./Properties/fuego_deploy.properties"/>
              <fuego:passport id="fuego.passport"
    directoryid="${fuego.directoryid}"
    preset="engine" />
    <target name="publish" description="Publish and deploy processes" depends = "takeInputs">
    <!-- Open a session to the Oracle BPM directory -->
    <fuego:session
    passportref="fuego.passport"
    verbose="true"
                   properties="${fuego.basedir}/conf/directory.xml"
    haltonerror="true" >
    <!-- Publish processes -->
    <fuego:publish fpr="${fuego.project.name}"
    deploy="true"
    engine="${fuego.engineName}"
                        importdata = "${fuego.importdata}"
                        automaproles="${fuego.automaproles}"
                        automapbuspars = "${fuego.automapbuspars}"
                        automapvars="${fuego.automapvars}"
                        automapconfigs = "${fuego.automapconfigs}">
    </fuego:publish>
    </fuego:session>
    </target>
    <target name= "takeInputs" >
    <input
    message="Please enter admin-username:"
    addproperty="fuego.participant"
    />
    <input
    message="Please enter admin-password:"
    addproperty="fuego.password"
    >
    </input>
    </target>
    </project>
    and find the properties I have used..
    fuego.basedir=C:\OraBPMEnterpriseHome
    fuego.directoryid=default
    fuego.engineName = bpmengine
    fuego.project.name = E:/antExamples/Project/CommonUtilities
    # If the below property is true then ant script imports data from the project, as defined in Studio.
    # This includes importing:
    #      •Holiday and Calendar rules
    #      •Organizational Units
    #      •Roles
    #      •Resource configurations
    #      •External Variables
    fuego.importdata = true
    #If the below property is true ant script automatically map abstract roles to real ones with the same name.
    fuego.automaproles=true
    #If the below property is true ant script automatically map business parameter variable names (as defined in the project design) to an business parameter variable id with the same name (as defined in the Fuego Enterprise directory).
    fuego.automapbuspars = true
    #If the below property is true ant script automatically map external variable names (as defined in the project design) to an external variable id with the same name (as defined in the Fuego Enterprise directory).
    fuego.automapvars=true
    #If the below property is true ant script automatically map External Resources configurations (as defined in the project design) to real Configurations with the same name (as defined in the Fuego Enterprise directory).
    fuego.automapconfigs = true

  • My touch pad is no longer responding to hard press downs for drag and drop or copy and paste

    my touch pad is no longer responding to hard press downs for drag and drop or copy and paste ability

    may be a totally stupid question, but how can I tell?

  • Need training material / test scripts for MRP and Supply Chain module. Can anyone hel

    Can anyone out there provide me with sample test scripts they may have used for upgrading to Oracle Financials 11i? Need sample scripts for MRP and Supply Chain management. Looking for good test scenarios for testing these modules. Appreciate any help. Email at [email protected]

    Can anyone out there provide me with sample test scripts they may have used for upgrading to Oracle 11i? Need sample scripts for MRP and Supply Chain management. Looking for good test scenarios for testing these modules. Appreciate any help. Email at [email protected]

  • NX-OS EEM script for SVI

    Hello, 
    I'm looking for a simple eem script for enabling an SVI if its goes down. we have some issue is NX-OS running 6.0.2.(1) where we occure a SVI down for itself.
    Regard
    Adil

    Unfortunately, this is not possible on NX-OS.  EEM on NX-OS is EEM by name only.  The feature is very different than it is on IOS.  What you could do is use an IOS box as a proxy.  That is, send a trap using EEM from your NX-OS box, then have IOS do the telnet to the other NX-OS box to perform the necessary commands.

  • Help with EEM TCL / CLI scripting for re-direction/wccp counters

    Being new with EEM scripting I wanted to see if I was on the right track and get some help to finish my idea.
    Our problem I am trying to fix is our remote sites utilize pairs of Cat3650's for some routing and WCCP redirection.  We are encountering ACL denial issues causing slow down and access issues.  The fix for the issue we remove the WCCP service groups to break peering with our wan optimizers and re-insert the configuration thus re-establishing peering and restoring service.
    My idea is to use a TCL scipt on a watchdog timer to parse the "sh ip wccp | inc denied (or unassign)" output for denial and unassignable error counters.  If a counter is found I wanted to create a syslog message that would then kick off a simple EEM CLI script to remove the service groups, wait 10 seconds, then re-add the service groups.  Please point me in the right direction if I am off track as I am not sure if I can use the EEM CLI for all this or since I want to retreive specific info from the sh ip wccp output if I do need to utilize TCL.  I am also unsure if the "total denied" ascii string pulled via the "sh ip wccp | inc denied" will cause issues when attempting to just pull the counter information.
    sh ip wccp | inc Denied Red
            Total Packets Denied Redirect:       0
            Total Packets Denied Redirect:       0
    Script thus far :
    TCL
    if [catch {context_retrieve "EEM_WCCP_ERROR_COUNTER" "count"} result] {
    set wccpcounter 0
    } else {
    set wccpcounter $result
    } if [catch {cli_open} result] {
    error $result
    } else {
    array set cli $result
    } if [catch {cli_exec $cli(fd) "show ip wccp | incl Denied"} result] {
    error $result
    } else {
    set cmd_output $result
    set count ""
    catch [regexp {receive ([0-9]+),} $cmd_output} ignore count]
    set count
    set diff [expr $count - $wccpcounter]
    if {$diff != 0} {
    action_syslog priority emergencies msg "WCCP counters showing incremental Denied packet counts"
    if [catch {cli_close $cli(fd) $cli(tty_id)} result] {
    error $result
    context_save EEM_WCCP_ERROR_COUNTER count
    CLI
    event manager applet WCCP_COUNTER_WATCH
    event syslog priority emergencies pattern "WCCP counters showing incremental Denied packet counts"
    action 001 cli command "enable"
    action 002 cli command "config t"
    action 003 cli command "no ip wccp 61"
    action 004 cli command "no ip wccp 62"
    action 005 wait 10
    action 006 cli command "ip wccp 61"
    action 007 cli command "ip wccp 62"
    action 008 wait 15
    action 009 cli command "clear ip wccp"
    action 010 cli command "end"
    Thanks for all the help

    This won't work as EEM cannot intercept its own syslog messages.  However, I'm not sure why you need this form of IPC anyway.  Why not just make the Tcl script perform the needed CLI commands?
    And, yes, you could use all applets here.  But since you've written the hard stuff in Tcl already, it might be best just to add the missing calls to reconfigure WCCP to that script.

  • Basic traceroute EEM script (for hop-by-hop network analysis)

    I'd like to do a hop-by-hop analysis by running a traceroute script that runs on an interval (say every 5-15 minutes) and puts output to a file.
    The goal is to let the script run for a day, and see what kind of hop changes might occur over time, and also monitor for any latency increase or packetloss at certain times of day (peak hours).
    If I used an EEM script to do a basic traceroute from one endpoint of the network to a server in the core (for instance), this could show how a client's path may be impacted during peak hours.
    I'd want the output stored in a file on the router's flash disk, and then I'd have to find some way to parse and analyze the output later (not sure how I'd do that, perhaps with excel or another diff-like program).

    Something like this should work for you.  In config mode, specify three EEM environment variables:
    event manager environment traceroute_timer 600
    event manager environment traceroute_target 10.1.1.1
    event manager environment traceroute_file flash:/traceroute.txt
    Then register this EEM Tcl policy:
    ::cisco::eem::event_register_timer watchdog time $traceroute_timer
    namespace import ::cisco::eem::*
    namespace import ::cisco::lib::*
    array set arr_einfo [event_reqinfo]
    if [catch {cli_open} result] {
        error $result $errorInfo
    } else {
        array set cli1 $result
    if [catch {cli_exec $cli1(fd) "enable"} _cli_result] {
        error $_cli_result $errorInfo
    if [catch {cli_exec $cli1(fd) "traceroute $traceroute_target"} _cli_result] {
        error $_cli_result $errorInfo
    set fd [open $traceroute_file a]
    puts $fd [clock format [clock seconds]]
    puts $fd $_cli_result
    close $fd
    # Close open cli before exit.
    catch {cli_close $cli1(fd) $cli1(tty_id)} result

  • How to shut no shut interface of switch using(EEM) Script for 3560 switch

    Dear community experts,
    I'm new for creating scripting for EEM and below is my situation, need your support.
    Present I'm using 3560 switch, one of  the switch port(FA0/1) has added  Cisco Access point(PoE), actually what happening daily this Access point getting struct when I'M doing the switch port (FA0/1) shut  then no shut it is working fine .
    So my question is i need script, that should continuously ping the IP off the Access point if the IP will drop 4 packets the switch do shut  and then no shut for that I need the script, Please help me.
    if it is not possible please provide the batch file, which will ping the particular IP if 4 packet drops it will telnet the switch and go to the interface do shut no shut 
    Note: 
    instead of mentioned 3560, I mentioned 2960 now corrected it  please provide the script.

    This should work:
    ip sla 1
     icmp-echo 10.10.10.1
     frequency 15
    ip sla schedule 1 life forever start now
    ip sla enable reaction-alerts
    ip sla reaction-configuration 1 react timeout action-type trapOnly threshold-type consecutive 4
    event manager applet reset-ap
     event ipsla operation-id 1 reaction-type timeout
     action 1.0 cli command "enable"
     action 2.0 cli command "config t"
     action 3.0 cli command "int fa0/1"
     action 4.0 cli command "shut"
     action 5.0 cli command "no shut"
     action 6.0 cli command "end"

  • Select All in a table does not work for Drag and Drop

    Hi. I am using Jdeveloper 11.1.1.2 but have also reproduced in 11.1.1.3.
    I am trying to implement drag and drop rows from one table to another. Everything works fine except when I do a Select All (ctrl-A) in a table, the table visually looks like all rows are selected, but when I try to click on one of the selected rows to drag to the other table, only the row I click on is dragged.
    I tried setting Range Size -1, fetch mode to FETCH_ALL, content delivery to "immediate" but nothing works.
    I even have reproduced not using a view object but just a List of beans with only 5 or 10 beans showing in the table.
    Does anyone know how to get Select All to work for a Drag Source?
    Thanks.
    -Ed

    Frank-
    OK, thanks for looking into that. I also submitted this service request, which includes a simple sample app to demonstrate the problem:
    SR #3-2387481211: ADF Drag and Drop does not work for rows in table using Select All
    Thanks again for the reply.
    -Ed

  • Shell script for moving and renaming files

    I'm not so familiar with shell scripts. I have created some simple scripts for various tasks but now I hit something I can't handle myself.
    My server receives every night a logfile from another server. This file I need to rename and move to another location. Problem is that a simple mv with new filename isn't enough, I need to insert date in filename. Format for date should be ddmmyy. Also the name of incoming file changes every night. The output always starts with same letters, let's say "log", and the date is used to identify files.
    For example I receive a file /Input/filename.log and I need to move the file to the folder /Output with name log130308.txt.
    Any tips how to insert the date as part of of filename while renaming or moving the file? I prefer shell script as I'll use launchd for scheduling the script.

    Hi again,
    so far I've constructed this:
    cd /input
    for file in `ls *log`
    do
    echo "Copying " $file
    cp $file /output/log.$file.`date +%d%m%y`
    done
    Quite there. I'm cding to directory, i'll focus later how to set some environmental parameters.
    Problem with zipping is that I don't know exact logfiles names. Each day there's a new name. So zip -q filename.zip filename.log isn't quite enough and it's impossible to use wildcards. The switch -q and checksums were welcome suggestions.
    Thanks again,
    Juha
    Message was edited by: J.Otava

  • [SOLVED] advanced shell script for mount and unmount samba share

    Good morning guys,
    Today I've a very long question....
    Hope in your help....:
    I usually move from different network.
    For one of those I need to mount some share that are under an ActiveDirectory server.
    To do that I use samba.
    Especially I've made and use the below  shell script.
    I know that it's so stupid but I'm a very newbie:
    #!/bin/sh
    echo "This is a custom script for mount my citrix share"
    echo "Please insert user password (must a sudoer user)"
    echo " "
    sudo mount -t cifs -o username='myusername',password='mypassword' //host_ip/TsHome$/myusername /home/myuser/samba_share/TsHOME
    sudo mount -t cifs -o username='myusername',password='mypassword' "//host_ip/direction" /home/myuser/samba_share/direction
    echo " "
    read -p "Press ENTER key to close this terminal"
    exit
    As I say the script work but it's so crude...!
    I want/need to implement it whit the follow addictions:
    1. print a feedback on mount: somenthing like "TsHOME is now mounted" or "unable to mount TsHOME"
    2. check if the share are already mounted: to prevent accidentally multiple mount. If a share is already mounted I want to print something like "TsHOME is already mounted on /home/myuser/samba_share/TsHOME"
    3. ask for share password  (now it's in clear on script) - This is optinal
    4. un-mount the share before reboot or shutdown command. That because I've notice that If i reboot or shutdown without manually un-mount the share the step of unmounting network file system became very slow
    If it's no extremely difficult, can someone help me to write this script?
    I know that man exist but I'm not a programmer and it's so difficult for me approch it.
    Thank you in advance.
    Ale
    Last edited by Alexbit (2010-09-23 21:29:13)

    Thank you very (VERY) much!
    I've follow your information and.. it work!
    If can be usefull to other this is the complete script:
    #!/bin/sh
    echo "This is a custom script for mount citrix share"
    echo "****************************************"
    echo " "
    echo "Please insert domain password:"
    read -s mypassword
    echo " "
    echo "|checking mount state...in share are not mounted mount it!|"
    echo "+-------------------------------------------------------------------------+"
    if grep "TsHome" /etc/mtab &>/dev/null; then
    grep "TsHome" /etc/mtab | awk '{print "TsHome is already mounted on " $2}'
    else
    sudo mount -t cifs -o username='yourusername',password="$mypassword" //ipaddress/TsHome$ /home/Samba_share/TsHOME && echo "TsHOME is now mounted" || echo "unable to mount TsHOME"
    fi
    echo " "
    if grep "direction" /etc/mtab &>/dev/null; then
    grep "direction" /etc/mtab | awk '{print "direction is already mounted on " $2}'
    else
    sudo mount -t cifs -o username='yourusername',password="$mypassword" '//ipaddress/direction' /home/Samba_share/direction' && echo "direction pat is now mounted" || echo "unable to mount direction"
    fi
    echo " "
    if grep "Area" /etc/mtab &>/dev/null; then
    grep "Area" /etc/mtab | awk '{print "Area is already mounted on " $2}'
    else
    sudo mount -t cifs -o username='yourusername',password="$mypassword" '//ipaddress/Area' /home/Samba_share/Area && echo "Area is now mounted" || echo "unable to mount Area"
    fi
    echo " "
    echo "All DONE!"
    echo " "
    read -p "Press ENTER key to close this terminal"
    exit
    I don't really well understand what I've to put in rc.local.shutdown....
    I think somethings like:
    #!/bin/bash
    # /etc/rc.local.shutdown: Local shutdown script.
    echo "This is a custom script for UN-mount citrix share"
    echo "********************************************"
    echo " "
    echo "|check mount state: if mount then un-mount!|"
    echo "+-------------------------------------------------------+"
    echo " "
    if grep "TsHome" /etc/mtab &>/dev/null; then
    grep "TsHome" /etc/mtab | awk '{print "TsHome is NOT mounted -> going on..." $2}'
    else
    sudo umount /home/Samba_share/TsHOME && echo "TsHOME is now UN mounted" || echo "unable to UN-mount TsHOME"
    fi
    echo " "
    if grep "direction" /etc/mtab &>/dev/null; then
    grep "direction" /etc/mtab | awk '{print "direction is NOT mounted -> going on.." $2}'
    else
    sudo umount /home/Samba_share/direction && echo "direction is now UN mounted" || echo "unable to UN-mount direction pat"
    fi
    echo " "
    if grep "Area" /etc/mtab &>/dev/null; then
    grep "Area" /etc/mtab | awk '{print "Area is NOT mounted - Finished" $2}'
    else
    sudo umount /home/Samba_share/Area && echo "Area is now UN mounted" || echo "unable to UN-mount Area"
    fi
    echo " "
    echo "going shutdown"
    echo " "
    sleep 5
    I've try but it seems to ignore the IF statement... this is the output when ALL share are UNmounted:
    $ sh /etc/rc.local.shutdown
    This is a custom script for UN-mount citrix share
    |check mount state: if mount then un-mount!|
    +-------------------------------------------------------+
    umount: /home/Samba_share/TsHOME: not mounted
    unable to UN-mount TsHOME
    umount: /home/Samba_share/direction: not mounted
    unable to UN-mount direction
    umount: /home/Samba_share/Area: not mounted
    unable to UN-mount Area
    going shutdown
    Tomorrow I will test again when I'm at office.
    Meanwhile can you check if I made a macroscopic mistakes?
    Thank you again!
    Last edited by Alexbit (2010-09-23 17:34:49)

Maybe you are looking for