monitors:samba_servers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
monitors:samba_servers [2014/02/23 09:11] – [Installation] doctor_madnessmonitors:samba_servers [2014/02/23 09:15] – [Samba monitoring] doctor_madness
Line 4: Line 4:
 ^ Compatibility | From Xymon 4.2.0 to Xymon 4.2.3 | ^ Compatibility | From Xymon 4.2.0 to Xymon 4.2.3 |
 ^ Requirements | sh (or bash), samba tool suite for Uni* (smbclient, smbtree...) | ^ Requirements | sh (or bash), samba tool suite for Uni* (smbclient, smbtree...) |
-^ Download | https://www.makelofine.org/xymon-plugins/hobbit-samba-v0.2.2.tar.bz2 | +^ Download | https://www.makelofine.org/xymon-plugins/hobbit-samba-v0.2.3.tar.bz2 | 
-^ Last Update | 2009-11-21 |+^ Last Update | 2014-02-23 |
  
 ===== Description ===== ===== Description =====
Line 26: Line 26:
 #!/bin/sh                                         #!/bin/sh                                        
 # ALL THIS SCRIPT IS UNDER GPL LICENSE            # ALL THIS SCRIPT IS UNDER GPL LICENSE           
-#Version 0.2.                                  +#Version 0.2.                                  
 # Title:     hobbit-samba                         # Title:     hobbit-samba                        
 # Author:    Damien Martins  ( doctor |at| makelofine |dot| org)                                                                                                                                                # Author:    Damien Martins  ( doctor |at| makelofine |dot| org)                                                                                                                                               
-# Date:      2009-07-26                                                                                                                                                                                        +# Date:      2014-02-23                                                                                                                                                                                        
 # Purpose:   Check samba servers/shares status                                                                                                                                                                  # Purpose:   Check samba servers/shares status                                                                                                                                                                 
 # Platforms: Uni* having samba tools suite (smbclient, smbtree)                                                                                                                                                 # Platforms: Uni* having samba tools suite (smbclient, smbtree)                                                                                                                                                
Line 41: Line 41:
 #                                                                                                                                                                                                               #                                                                                                                                                                                                              
 # History :                                                                                                                                                                                                     # History :                                                                                                                                                                                                    
-                                                                                                                                                                                                             +                                                                                                             # - 23 feb 2014 - Damien Martins 
 +# v0.2.3        -Add checks on SMBCLIENT and SMBTREE files                                                                                                
 # - 26 jul 2009 - Damien Martins                                                                                                                                                                                # - 26 jul 2009 - Damien Martins                                                                                                                                                                               
 # v0.2.1        -Bug fix on hobbit-samba.conf management getting duplicated lines.                                                                                                                              # v0.2.1        -Bug fix on hobbit-samba.conf management getting duplicated lines.                                                                                                                             
Line 124: Line 125:
         exit 1                                                                                                                            exit 1                                                                                                                   
 fi                                                                                                                                fi                                                                                                                               
 +if [ ! -f "$SMBCLIENT" ] ; then
 +        echo "smbclient not found, please install samba-tools"
 +        exit 1
 +fi
 +
 +if [ ! -x "$SMBCLIENT" ] ; then
 +        echo "Unable to execute smbclient, please check permissions"
 +        exit 1
 +fi
  
 #Infos for later releases #Infos for later releases
Line 233: Line 243:
 RESTRICTED=$($GREP "RESTRICT=" $CONFIG_FILE |$AWK -F= '{print $2}' |$TR [:upper:] [:lower:]) RESTRICTED=$($GREP "RESTRICT=" $CONFIG_FILE |$AWK -F= '{print $2}' |$TR [:upper:] [:lower:])
 if [ "$RESTRICTED" == "yes" ] ; then if [ "$RESTRICTED" == "yes" ] ; then
 +        if [ ! -f "$SMBTREE" ] ; then
 +       echo "Can't find smbtree, please install samba-tools"
 + exit 1
 + fi
 + if [ ! -x "$SMBTREE" ] ; then
 + echo "Unable to execute smbtree, please check permissions"
 + exit 1
 + fi
 +
         restrict         restrict
 elif [ "$RESTRICTED" == "no" ] ; then elif [ "$RESTRICTED" == "no" ] ; then
  • monitors/samba_servers.txt
  • Last modified: 2018/11/01 14:30
  • by doktoil_makresh