From 3563d18c0c6299963adab395804a49e27b958ecf Mon Sep 17 00:00:00 2001 From: Benjamin Bohard Date: Mon, 7 Sep 2020 16:43:21 +0200 Subject: [PATCH] =?UTF-8?q?=C3=A9l=C3=A9ments=20pour=20les=20exercices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../creole-dictionnaire-structure.tex | 7 + .../modules_EOLE_envole/exercices/creole.dtd | 237 ++++++++++++++++++ .../exercices/vnstat-activation.tex | 2 + .../exercices/vnstat-contrainte.tex | 2 + .../exercices/vnstat-documentation.tex | 2 + .../exercices/vnstat-gestion-reseau.tex | 2 + .../exercices/vnstat-gestion-service.tex | 2 + .../exercices/vnstat-template.tex | 2 + .../ressources/vnstat/90-vnstat | 16 ++ .../ressources/vnstat/vnstat.conf | 170 +++++++++++++ 10 files changed, 442 insertions(+) create mode 100644 content/modules_EOLE_envole/exercices/creole-dictionnaire-structure.tex create mode 100644 content/modules_EOLE_envole/exercices/creole.dtd create mode 100644 content/modules_EOLE_envole/exercices/vnstat-activation.tex create mode 100644 content/modules_EOLE_envole/exercices/vnstat-contrainte.tex create mode 100644 content/modules_EOLE_envole/exercices/vnstat-documentation.tex create mode 100644 content/modules_EOLE_envole/exercices/vnstat-gestion-reseau.tex create mode 100644 content/modules_EOLE_envole/exercices/vnstat-gestion-service.tex create mode 100644 content/modules_EOLE_envole/exercices/vnstat-template.tex create mode 100755 content/modules_eole_envole/ressources/vnstat/90-vnstat create mode 100644 content/modules_eole_envole/ressources/vnstat/vnstat.conf diff --git a/content/modules_EOLE_envole/exercices/creole-dictionnaire-structure.tex b/content/modules_EOLE_envole/exercices/creole-dictionnaire-structure.tex new file mode 100644 index 0000000..091d067 --- /dev/null +++ b/content/modules_EOLE_envole/exercices/creole-dictionnaire-structure.tex @@ -0,0 +1,7 @@ +\skbheading{Explorer la structure d’un dictionnaire Creole} + +Un dictionnaire Creole est une description de la configuration à l’aide du format de fichier \emph{xml}. + +fichier content/modules\_EOLE\_envole/exercices/creole-dictionnaire-structure.tex à éditer + +\inputminted[]{xml}{./content/modules_EOLE_envole/exercices/creole.dtd} diff --git a/content/modules_EOLE_envole/exercices/creole.dtd b/content/modules_EOLE_envole/exercices/creole.dtd new file mode 100644 index 0000000..91cec67 --- /dev/null +++ b/content/modules_EOLE_envole/exercices/creole.dtd @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/content/modules_EOLE_envole/exercices/vnstat-activation.tex b/content/modules_EOLE_envole/exercices/vnstat-activation.tex new file mode 100644 index 0000000..f34aefd --- /dev/null +++ b/content/modules_EOLE_envole/exercices/vnstat-activation.tex @@ -0,0 +1,2 @@ +\skbheading{vnstat-activation.tex} +fichier content/modules\_EOLE\_envole/exercices/vnstat-activation.tex à éditer \ No newline at end of file diff --git a/content/modules_EOLE_envole/exercices/vnstat-contrainte.tex b/content/modules_EOLE_envole/exercices/vnstat-contrainte.tex new file mode 100644 index 0000000..5c7283d --- /dev/null +++ b/content/modules_EOLE_envole/exercices/vnstat-contrainte.tex @@ -0,0 +1,2 @@ +\skbheading{vnstat-contrainte.tex} +fichier content/modules\_EOLE\_envole/exercices/vnstat-contrainte.tex à éditer \ No newline at end of file diff --git a/content/modules_EOLE_envole/exercices/vnstat-documentation.tex b/content/modules_EOLE_envole/exercices/vnstat-documentation.tex new file mode 100644 index 0000000..3baace4 --- /dev/null +++ b/content/modules_EOLE_envole/exercices/vnstat-documentation.tex @@ -0,0 +1,2 @@ +\skbheading{vnstat-documentation.tex} +fichier content/modules\_EOLE\_envole/exercices/vnstat-documentation.tex à éditer \ No newline at end of file diff --git a/content/modules_EOLE_envole/exercices/vnstat-gestion-reseau.tex b/content/modules_EOLE_envole/exercices/vnstat-gestion-reseau.tex new file mode 100644 index 0000000..fd42937 --- /dev/null +++ b/content/modules_EOLE_envole/exercices/vnstat-gestion-reseau.tex @@ -0,0 +1,2 @@ +\skbheading{vnstat-gestion-reseau.tex} +fichier content/modules\_EOLE\_envole/exercices/vnstat-gestion-reseau.tex à éditer \ No newline at end of file diff --git a/content/modules_EOLE_envole/exercices/vnstat-gestion-service.tex b/content/modules_EOLE_envole/exercices/vnstat-gestion-service.tex new file mode 100644 index 0000000..3d34969 --- /dev/null +++ b/content/modules_EOLE_envole/exercices/vnstat-gestion-service.tex @@ -0,0 +1,2 @@ +\skbheading{vnstat-gestion-service.tex} +fichier content/modules\_EOLE\_envole/exercices/vnstat-gestion-service.tex à éditer \ No newline at end of file diff --git a/content/modules_EOLE_envole/exercices/vnstat-template.tex b/content/modules_EOLE_envole/exercices/vnstat-template.tex new file mode 100644 index 0000000..3c38491 --- /dev/null +++ b/content/modules_EOLE_envole/exercices/vnstat-template.tex @@ -0,0 +1,2 @@ +\skbheading{vnstat-template.tex} +fichier content/modules\_EOLE\_envole/exercices/vnstat-template.tex à éditer \ No newline at end of file diff --git a/content/modules_eole_envole/ressources/vnstat/90-vnstat b/content/modules_eole_envole/ressources/vnstat/90-vnstat new file mode 100755 index 0000000..0a6dbbf --- /dev/null +++ b/content/modules_eole_envole/ressources/vnstat/90-vnstat @@ -0,0 +1,16 @@ +#!/bin/bash + +#set -e +. /usr/lib/eole/diagnose.sh +EchoGras "*** Service de statistique réseau" + +if [ "$(CreoleGet activer_vnstat)" = "oui" ]; then + TestPid vnStat vnstatd + echo + vnstat +else + Inactif vnStat +fi + +echo +exit 0 diff --git a/content/modules_eole_envole/ressources/vnstat/vnstat.conf b/content/modules_eole_envole/ressources/vnstat/vnstat.conf new file mode 100644 index 0000000..f600eb3 --- /dev/null +++ b/content/modules_eole_envole/ressources/vnstat/vnstat.conf @@ -0,0 +1,170 @@ +# vnStat 1.18 config file +## + +# default interface +%set %%interfaces = [] +%for interface in %%vnstat_interface +%set %%zone = 'nom_zone_eth' + interface +%silent %%interfaces.append(%%getVar(%%zone)) +%end for +Interface "%%custom_join(%%interfaces,'+']" + +# location of the database directory +DatabaseDir "/var/lib/vnstat" + +# locale (LC_ALL) ("-" = use system locale) +Locale "-" + +# on which day should months change +MonthRotate 1 + +# date output formats for -d, -m, -t and -w +# see 'man date' for control codes +DayFormat "%x" +MonthFormat "%b '%y" +TopFormat "%x" + +# characters used for visuals +RXCharacter "%" +TXCharacter ":" +RXHourCharacter "r" +TXHourCharacter "t" + +# how units are prefixed when traffic is shown +# 0 = IEC standard prefixes (KiB/MiB/GiB/TiB) +# 1 = old style binary prefixes (KB/MB/GB/TB) +UnitMode 0 + +# how units are prefixed when traffic rate is shown +# 0 = IEC binary prefixes (Kibit/s...) +# 1 = SI decimal prefixes (kbit/s...) +RateUnitMode 1 + +# output style +# 0 = minimal & narrow, 1 = bar column visible +# 2 = same as 1 except rate in summary and weekly +# 3 = rate column visible +OutputStyle 3 + +# used rate unit (0 = bytes, 1 = bits) +RateUnit 1 + +# number of decimals to use in outputs +DefaultDecimals 2 +HourlyDecimals 1 + +# spacer for separating hourly sections (0 = none, 1 = '|', 2 = '][', 3 = '[ ]') +HourlySectionStyle 2 + +# try to detect interface maximum bandwidth, 0 = disable feature +# MaxBandwidth will be used as fallback value when enabled +BandwidthDetection 1 + +# maximum bandwidth (Mbit) for all interfaces, 0 = disable feature +# (unless interface specific limit is given) +MaxBandwidth 1000 + +# interface specific limits +# example 8Mbit limit for eth0 (remove # to activate): +#MaxBWeth0 8 + +# how many seconds should sampling for -tr take by default +Sampletime 5 + +# default query mode +# 0 = normal, 1 = days, 2 = months, 3 = top10 +# 4 = exportdb, 5 = short, 6 = weeks, 7 = hours +QueryMode 0 + +# filesystem disk space check (1 = enabled, 0 = disabled) +CheckDiskSpace 1 + +# database file locking (1 = enabled, 0 = disabled) +UseFileLocking 1 + +# how much the boot time can variate between updates (seconds) +BootVariation 15 + +# log days without traffic to daily list (1 = enabled, 0 = disabled) +TrafficlessDays 1 + + +# vnstatd +## + +# switch to given user when started as root (leave empty to disable) +DaemonUser "%%vnstat_user" + +# switch to given user when started as root (leave empty to disable) +DaemonGroup "%%vnstat_group" + +# how many minutes to wait during daemon startup for system clock to +# sync time if most recent database update appears to be in the future +TimeSyncWait 5 + +# how often (in seconds) interface data is updated +UpdateInterval 30 + +# how often (in seconds) interface status changes are checked +PollInterval 5 + +# how often (in minutes) data is saved to file +SaveInterval 5 + +# how often (in minutes) data is saved when all interface are offline +OfflineSaveInterval 30 + +# how often (in minutes) bandwidth detection is redone when +# BandwidthDetection is enabled (0 = disabled) +BandwidthDetectionInterval 5 + +# force data save when interface status changes (1 = enabled, 0 = disabled) +SaveOnStatusChange 1 + +# enable / disable logging (0 = disabled, 1 = logfile, 2 = syslog) +UseLogging 2 + +# create dirs if needed (1 = enabled, 0 = disabled) +CreateDirs 1 + +# update ownership of files if needed (1 = enabled, 0 = disabled) +UpdateFileOwner 1 + +# file used for logging if UseLogging is set to 1 +LogFile "/var/log/vnstat/vnstat.log" + +# file used as daemon pid / lock file +PidFile "/var/run/vnstat/vnstat.pid" + + +# vnstati +## + +# title timestamp format +HeaderFormat "%x %H:%M" + +# show hours with rate (1 = enabled, 0 = disabled) +HourlyRate 1 + +# show rate in summary (1 = enabled, 0 = disabled) +SummaryRate 1 + +# layout of summary (1 = with monthly, 0 = without monthly) +SummaryLayout 1 + +# transparent background (1 = enabled, 0 = disabled) +TransparentBg 0 + +# image colors +CBackground "FFFFFF" +CEdge "AEAEAE" +CHeader "606060" +CHeaderTitle "FFFFFF" +CHeaderDate "FFFFFF" +CText "000000" +CLine "B0B0B0" +CLineL "-" +CRx "92CF00" +CTx "606060" +CRxD "-" +CTxD "-"