1. #!/bin/bash
  2.  
  3. if [ "$#" -ne 1 ];
  4.             then echo "UNKNOWN:You need to supply ethernet interface"
  5.             exit 3
  6. fi
  7.  
  8. if [ "`/sbin/ifconfig | /bin/grep $1 | /usr/bin/wc -l`" -gt 0 ]; then
  9.         echo "CRITICAL: Interface $1 is up and it should not be that"
  10.         exit 2
  11. else
  12.         echo "OK: Interface $1 is still down and we like that"
  13.         exit 0
  14. fi
  15.  

Posted by Anonymous at 26 Oct 2013, 10:26:58 Europe/Berlin
Language: bash