[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/usr/share/se3/scripts/ -> infose.sh (source)

   1  #!/bin/bash
   2  
   3  ## $Id: infose.sh 7061 2012-04-02 09:22:45Z dbo $ ##
   4  #
   5  ##### Retourne en HTML diverses informations sur SambaEdu #####
   6  #
   7  # Olivier LECLUSE 13 09 2002
   8  # Modif jean NAVARRO 25/02/2005
   9  
  10  grpdn="$2,$3"
  11  usrdn="$1,$3"
  12  smbpath=$4
  13  
  14  echo "<H1>Informations générales SambaEdu</H1>"
  15  echo "<H2>Informations sur les comptes</H2>"
  16  nbg=`ldapsearch -x -b "$grpdn" "cn=*" "cn" |grep dn: |wc -l`
  17  echo "<UL><LI>Nombre de groupes : $nbg</LI>"
  18  
  19  nbCl=`ls /var/se3/Classes | wc -l`
  20  echo "<LI>Nombre de Classes : $nbCl</LI>"
  21  
  22  nbg=`cat $smbpath |grep "\[" |wc -l`
  23  let nbg=nbg-2
  24  echo "<LI>Nombre de partages : $nbg</LI></UL>"
  25  
  26  
  27  echo ""
  28  nbc=`ldapsearch -x -b "$usrdn" "uid=*" "uid" |grep dn: |wc -l`
  29  nbcu=`ls /home/|wc -l`
  30  #moins admin, netlogon, templates
  31  let nbcu=nbcu-3
  32  echo "<LI>Nombre de comptes inscrits : $nbc   ==> utilisés : $nbcu</LI>"
  33  
  34  
  35  nbProfs=`ldapsearch -xLLL cn=Profs |grep memberUid | wc -l`
  36  
  37  let "i= 0"
  38  let "nbpa= 0"
  39  uid=(`ldapsearch -xLLL cn=Profs | grep memberUid |cut -d" " -f2`)
  40  while [ "$i" -lt "${#uid[@]}" ]
  41  do   
  42      if [ -d /home/$uid[$i]} ]; then 
  43      ((nbpa += 1))
  44      fi
  45      ((i += 1))
  46  done
  47  let "pcprof = $nbpa * 100 / $nbProfs"
  48  echo "<LI>Nombre de profs inscrits : $nbProfs   ==> actifs : $nbpa  ($pcprof%)</LI>"
  49  
  50  nbEleves=`ldapsearch -xLLL cn=eleves | grep memberUid | wc -l`
  51  
  52  let "i= 0"
  53  let "nbela= 0"
  54  uid=(`ldapsearch -xLLL cn=eleves | grep memberUid |cut -d" " -f2`)
  55  while [ "$i" -lt "${#uid[@]}" ]
  56  do   
  57      if [ -d /home/$uid[$i]} ]; then 
  58      ((nbela += 1))
  59      fi
  60      ((i += 1))
  61  done
  62  let "pcelev = $nbela * 100 / $nbEleves"
  63  echo "<LI>Nombre d'élèves inscrits : $nbEleves ==>  actifs : $nbela ($pcelev%)</LI>"
  64  
  65  
  66  cat <<EOF
  67  <H2>Utilisation de la mémoire</H2>
  68  <BLOCKQUOTE><PRE>
  69  EOF
  70  
  71  free -m
  72  
  73  cat <<EOF
  74  </PRE></BLOCKQUOTE>
  75  <H2>Informations sur le Noyau</H2>
  76  <BLOCKQUOTE><PRE>
  77  EOF
  78  
  79  uname -a
  80  
  81  cat <<EOF
  82  </PRE></BLOCKQUOTE>
  83  <H2>Processus en cours</H2>
  84  <BLOCKQUOTE><PRE>
  85  EOF
  86  
  87  top -b -n1
  88  
  89  echo "</PRE></BLOCKQUOTE>"


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1