#!/bin/bash ## $Id: infose.sh 7061 2012-04-02 09:22:45Z dbo $ ## # ##### Retourne en HTML diverses informations sur SambaEdu ##### # # Olivier LECLUSE 13 09 2002 # Modif jean NAVARRO 25/02/2005 grpdn="$2,$3" usrdn="$1,$3" smbpath=$4 echo "

Informations générales SambaEdu

" echo "

Informations sur les comptes

" nbg=`ldapsearch -x -b "$grpdn" "cn=*" "cn" |grep dn: |wc -l` echo "" echo "" nbc=`ldapsearch -x -b "$usrdn" "uid=*" "uid" |grep dn: |wc -l` nbcu=`ls /home/|wc -l` #moins admin, netlogon, templates let nbcu=nbcu-3 echo "
  • Nombre de comptes inscrits : $nbc ==> utilisés : $nbcu
  • " nbProfs=`ldapsearch -xLLL cn=Profs |grep memberUid | wc -l` let "i= 0" let "nbpa= 0" uid=(`ldapsearch -xLLL cn=Profs | grep memberUid |cut -d" " -f2`) while [ "$i" -lt "${#uid[@]}" ] do if [ -d /home/${uid[$i]} ]; then ((nbpa += 1)) fi ((i += 1)) done let "pcprof = $nbpa * 100 / $nbProfs" echo "
  • Nombre de profs inscrits : $nbProfs ==> actifs : $nbpa ($pcprof%)
  • " nbEleves=`ldapsearch -xLLL cn=eleves | grep memberUid | wc -l` let "i= 0" let "nbela= 0" uid=(`ldapsearch -xLLL cn=eleves | grep memberUid |cut -d" " -f2`) while [ "$i" -lt "${#uid[@]}" ] do if [ -d /home/${uid[$i]} ]; then ((nbela += 1)) fi ((i += 1)) done let "pcelev = $nbela * 100 / $nbEleves" echo "
  • Nombre d'élèves inscrits : $nbEleves ==> actifs : $nbela ($pcelev%)
  • " cat <Utilisation de la mémoire
    EOF
    
    free -m
    
    cat <

    Informations sur le Noyau

    EOF
    
    uname -a
    
    cat <

    Processus en cours

    EOF
    
    top -b -n1
    
    echo "
    "