[bcfg2/tv] Ajout d'un probe pour desactiver des cartes dvb
Le fichier /etc/sat/cartesdvbdesactivees.local doit contenir la liste des numeros des cartes desactives separees par des espaces darcs-hash:20090410111203-c9953-587fbcd9dcae1572e387222a000c7e9cbb8a908b.gz
This commit is contained in:
parent
066da75a14
commit
20dd631022
3 changed files with 26 additions and 8 deletions
12
Probes/cartesdvbdesactivees_local
Executable file
12
Probes/cartesdvbdesactivees_local
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#Ce fichier doit contenir la liste des cartes desactivees separees par un espace
|
||||||
|
|
||||||
|
if [ ! -f /etc/sat/cartesdvbdesactivees.local ]; then
|
||||||
|
echo "none"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "group:cartesdvbdesactivees.local"
|
||||||
|
|
||||||
|
exec cat /etc/sat/cartesdvbdesactivees.local
|
|
@ -21,9 +21,12 @@ header('Fichier de configuration de mumudvb')
|
||||||
@#Ex : ADAPTERS="0 1 2 4"
|
@#Ex : ADAPTERS="0 1 2 4"
|
||||||
|
|
||||||
dernierecarte=int(metadata.probes["cartesdvb"])
|
dernierecarte=int(metadata.probes["cartesdvb"])
|
||||||
|
cartesdesactivees=map(lambda x : int(x),metadata.probes["cartesdvbdesactivees_local"].split(' '))
|
||||||
|
|
||||||
adapters=""
|
adapters=""
|
||||||
for i in range(0,dernierecarte):
|
for i in range(0,dernierecarte):
|
||||||
adapters=adapters +str(i) +" "
|
if not i in cartesdesactivees:
|
||||||
|
adapters=adapters +str(i) +" "
|
||||||
|
|
||||||
adapters=adapters[:-1]
|
adapters=adapters[:-1]
|
||||||
|
|
||||||
|
|
|
@ -165,14 +165,17 @@ service("vsftpd-federez",
|
||||||
extra=["if failed host 138.231.136.129 port 21 protocol ftp timeout 30 seconds then restart"])
|
extra=["if failed host 138.231.136.129 port 21 protocol ftp timeout 30 seconds then restart"])
|
||||||
|
|
||||||
dernierecarte=int(metadata.probes["cartesdvb"])
|
dernierecarte=int(metadata.probes["cartesdvb"])
|
||||||
if dernierecarte:
|
cartesdesactivees=map(lambda x : int(x),metadata.probes["cartesdvbdesactivees_local"].split(' '))
|
||||||
print "# Il y a %d carte(s) DVB sur ce serveur\n" % dernierecarte
|
|
||||||
for i in range(0,dernierecarte):
|
|
||||||
service("mumudvb",
|
|
||||||
name = "mumudvb%d" % i,
|
|
||||||
init = "mumudvb",
|
|
||||||
pidf = "mumudvb/mumudvb_carte%d" % i)
|
|
||||||
|
|
||||||
|
if dernierecarte:
|
||||||
|
print "# Il y a %d carte(s) DVB sur ce serveur dont %d cartes desactivee(s)\n" % (dernierecarte,len(cartesdesactivees))
|
||||||
|
for i in range(0,dernierecarte):
|
||||||
|
if not i in cartesdesactivees:
|
||||||
|
service("mumudvb",
|
||||||
|
name = "mumudvb%d" % i,
|
||||||
|
init = "mumudvb",
|
||||||
|
pidf = "mumudvb/mumudvb_carte%d" % i)
|
||||||
|
|
||||||
@check file file/var/log/syslog with path /var/log/syslog
|
@check file file/var/log/syslog with path /var/log/syslog
|
||||||
@ if timestamp > 15 minutes then alert
|
@ if timestamp > 15 minutes then alert
|
||||||
@
|
@
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue