getInfo 2.35.2

This commit is contained in:
kyodev 2017-11-15 15:16:49 +01:00
parent c9733253d8
commit f4c1ee10fd
2 changed files with 17 additions and 12 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=2.35.1
version=2.35.2
date="15/11/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -1697,7 +1697,7 @@ fi_ssid(){ # 09/11/2017
fi_system_analyse(){ # 15/11/2017
[ "$(f__cmd_exist systemd)" ] || return 0 # pas systemd
local bootTime bootBlame bootCritic bootGraph srvcFail text
local bootTime bootBlame bootCritic bootGraph srvcFail srvcFail_list isrvc text
local alert_srvcFail
# durée du précédent boot
bootTime=$( systemd-analyze time )
@ -1707,8 +1707,8 @@ fi_system_analyse(){ # 15/11/2017
bootBlame=$( systemd-analyze blame | head -n 20 )
# services critiques ralentisseurs
bootCritic=$( systemd-analyze critical-chain )
bootCritic="${bootCritic/The time after the unit is active or started is printed after the \"@\" character./@: temps pour que l\'unité soit active ou démarrée}"
bootCritic="${bootCritic/The time the unit takes to start is printed after the \"+\" character./+: temps que l\'unité prend pour démarrer}"
bootCritic="${bootCritic/The time after the unit is active or started is printed after the \"@\" character./ @: temps pour que l\'unité soit active ou démarrée}"
bootCritic="${bootCritic/The time the unit takes to start is printed after the \"+\" character./ +: temps que l\'unité prend pour démarrer}"
# génération graphique
systemd-analyze plot > /tmp/getInfo-graph.svg
bootGraph="[file:///tmp/getInfo-graph.svg](file:///tmp/getInfo-graph.svg) \n"
@ -1717,14 +1717,18 @@ fi_system_analyse(){ # 15/11/2017
# un lien local ne s'ouvrira pas automatiquement :( : http://kb.mozillazine.org/Links_to_local_pages_do_not_work
# srvcFail=$( systemctl --state=active,failed | grep -cE 'error|not-found|failed' )
srvcFail=$( systemctl --state=active,failed | gawk '/error|not-found|failed/ { sub(/●/,"");
printf "%-40s %-11s %-8s %-8s %s",$1,$2,$3,$4,$5; $1=$2=$3=$4=$5=""; print $0}' )
printf "%-50s %-11s %-8s %-8s %s",$1,$2,$3,$4,$5; $1=$2=$3=$4=$5=""; print $0}' )
if [ $(f__wcv -l $srvcFail) -gt 0 ]; then
srvcFail_list=$( gawk '{print "systemctl status "$1}' <<< "$srvcFail" )
srvcFail=$( printf "%-40s %-11s %-8s %-8s %s" Unit Load Active Sub Description )$'\n'"$srvcFail"
alert_srvcFail="des services sont en erreur, en savoir plus: \n"
alert_srvcFail+='```\n'
alert_srvcFail+="$srvcFail_list \n"
alert_srvcFail+='```\n'
alert_srvcFail="statut des services en erreur: \n\n"
srvcFail_list=$( gawk '{print $1}' <<< "$srvcFail" )
for isrvc in $srvcFail_list; do
alert_srvcFail+="\`systemctl status $isrvc\` \n"
alert_srvcFail+='```\n'
alert_srvcFail+="$( systemctl status $isrvc 2>&1 ) \n"
alert_srvcFail+='```\n'
done
alert_srvcFail=${alert_srvcFail//●}
srvcFail=$( printf "%-50s %-11s %-8s %-8s %s" Unit Load Active Sub Description )$'\n'"$srvcFail"
fi
###
text="## analyse boot systemd \n\n"

View File

@ -5,11 +5,12 @@
## 2.35.1 15/11/2017
## 2.35.2 15/11/2017
* nouveau, révision : f_display, fi_system_analyse, affichage + services critiques, graphique services au chargement
* nouveau: fi_systeme, version systemd
* nouveau: fi_system_analyse, alerte services en erreur
* nouveau: fi_system_analyse, statut des services en erreur
* fix: fi_vrms
## 2.34.1 14/11/2017