Changeset 6414 for Serveur


Ignore:
Timestamp:
05/03/12 14:02:33 (7 years ago)
Author:
kent1
Message:

Améliorations de la doc + de sympa_spool

Location:
Serveur/munin/sympa4munin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Serveur/munin/sympa4munin/INSTALL

    r2901 r6414  
    11Sympa4munin
    22Original code from hagen at rz.uni-karlsruhe.de
    3 Version 0.2
     3Modified by kent1 <kent1@arscenic.info>
     4Version 0.3.1
    45
    56
     
    78
    89- copy plugins files sympa_stats and sympa_spool to /usr/share/munin/plugins/
    9 - you probably have to tell munin to run those plugins as the
    10   sympa-user. I put the following lines in /etc/munin/plugin-conf.d/munin-node:
    11 
    12 [sympa*]
    13 user sympa
    14 env.logfile /var/log/syslog
    15 env.spool /opt/sympa/spool
    16 
    17 [sympa_stats]
    18 user root
    19 
     10- you probably have to tell munin to run sympa_spool as the sympa-user if munin user can't read the content of the spool directory (cf config examples);
     11- you have to tell munin to run sympa_spool as a user who can read the logfile (root for the default /var/log/syslog)
    2012- run munin-node-configure --shell
    2113- copy / paste resulting commands to activate the plugins (should be 2 commands)
     
    2618- enjoy
    2719
    28 Please contact hagen at rz.uni-karlsruhe.de, if you have any suggestions,
    29 enhancements, etc.,
     20Parameters allowed:
     21
     22- user = user to run the script
     23
     24for sympa_spool :
     25- env.spool = path to the sympa spool directory (default /home/sympa/spool)
     26- env.queues = list of the spools to count (default auth bounce digest distribute expire moderation msg outgoing subscribe task tmp topic msg/bad distribute/bad)
     27
     28for sympa_stats
     29- env.logfile = path to the sympa log file (default /var/log/syslog)
     30
     31Example of configurations:
     32
     33[sympa_spool]
     34user sympa
     35env.spool /opt/sympa/spool
     36
     37[sympa_stats]
     38user root
     39
     40Please contact kent1@arscenic.info, if you have any suggestions,
     41enhancements, etc.
  • Serveur/munin/sympa4munin/sympa_spool

    r2899 r6414  
    1313#%# family=auto
    1414#%# capabilities=autoconf
    15 SYMPA_SPOOL="/home/sympa/spool"
    16 QUEUES="auth bounce digest distribute expire moderation msg outgoing subscribe task tmp topic msg/bad distribute/bad"
    17 if [ "$1" = "autoconf" ]; then
    18         echo yes
    19 fi
     15SYMPA_SPOOL=${spool:-/home/sympa/spool}
     16QUEUES=${queues:-auth bounce digest distribute expire moderation msg outgoing subscribe task tmp topic msg/bad distribute/bad}
    2017
    21 if [ "$1" = "config" ]; then
    22     echo 'graph_title Data in sympa-spool'
    23     echo 'graph_category sympa'
     18# If we have parameters to the script
     19case $1 in
     20        autoconf)
     21                if [ -d $SYMPA_SPOOL ] && [ -r $SYMPA_SPOOL ]; then
     22                        echo yes
     23                        exit 0
     24                else
     25                        echo "no (spool file not readable)"
     26                        exit 1
     27                fi
     28                ;;
     29        config)
     30                echo 'graph_title Data in sympa-spool'
     31                echo 'graph_category sympa'
     32                for i in $QUEUES ; do echo $i.draw LINE2 |tr "/" "_" ; echo -n "$i.label" | tr "/" "_" ; echo " $i" ; done ;
     33                exit 0
     34                ;;
     35esac
    2436
    25     for i in $QUEUES ; do echo $i.draw LINE2 |tr "/" "_" ; echo -n "$i.label" | tr "/" "_" ; echo " $i" ; done ;
    26     exit 0
    27 fi
    28 
    29 
     37# Else we show the results
    3038for i in $QUEUES ; do  COUNT=`find ${SYMPA_SPOOL}/$i -maxdepth 1 -type f|wc -l|tr -d " "`; echo $i.value $COUNT | tr "/" "_" ; done ;
  • Serveur/munin/sympa4munin/sympa_stats

    r2900 r6414  
    6161}
    6262
    63 
    64 
    6563if (-f "$logfile.0")
    6664{
     
    160158print "msgArchived.value $msgArchived\n";
    161159
    162 
    163 
    164160if(-l $statefile) {
    165161        die("$statefile is a symbolic link, refusing to touch it.");
    166162}
     163
    167164open (OUT, ">$statefile") or exit 4;
    168165print OUT "$pos:$badFiles:$oldFiles:$senderNotAllowed:$keyToEditors:$msgAccepted:$msgArchived\n";
     
    204201            $msgArchived++;
    205202        }
    206 
    207 
    208203    }
    209204    close(LOGFILE);
Note: See TracChangeset for help on using the changeset viewer.