Dies ist eine mobil optimierte Seite, die schnell lädt. Wenn Sie die Seite ohne Optimierung laden möchten, dann klicken Sie auf diesen Text.

Problema script di controllo

    Nobody is reading this thread right now.

jonfrusciante

Newbie
Registriert
21. Februar 2013
Beiträge
23
Reaktionspunkte
1
Punkte
3
salve ragazzi
ma come si inseriscono gli script con l'ipc??
per esempio vorrei inserire questo script trovato in rete
che dovrebbe controllare se i tempi di risposta se ub utente supera i 1000ms pscam si riavvia:



Oscam scripts to Check clienttimeout & auto restartHere is a script to check if a user gets a high ecm let say over 1000ms and it will restart Oscam automatically:
Set the clientimeout to "lets say 1000 ms".

The scipt i use on debian:

Dont forget to change
SIZE=
LOG=,
STARTSCRIPT=
and change the crontab !!!



#!/bin/bash


# accepable number of timeouts CAN'T BE LESS THAN THAT 2 "s client timeout=1000 ms, fallback timeout=700 ms, cache delay=0 ms"
SIZE="4"

# oscam init script
STARTSCRIPT="/etc/init.d/oscam"

# log file
LOG="/var/log/oscam.log"


CHECK="`tail -200 $LOG |grep -v grep |grep -c timeout`"

# If the the word "timeout" appears more times then SIZE ...
if [ "$CHECK" -gt "$SIZE" ]; then

# backup the log
#mv "$LOG" /var/log/oscamtimeout$(date '+%Y_%m_%d_%H:%M').log

# delete the log
rm "$LOG"
# logging restarts of oscam
echo 'oscam restarted becouse of timeot at' $(date '+%Y_%m_%d_%H:%M') >> /var/log/oscamtimeouts.log

#killing oscam
kill -KILL $(pidof oscam)

# wait 2 sec

sleep 2

# start oscam
"$STARTSCRIPT" start


else
echo 'nincs' > /dev/null
exit 1
fi

JON
 
Zuletzt bearbeitet von einem Moderator:
AW: script di controllo

potrebbe funzionare cosi esempio
check.sh
#!/bin/bash

# accepable number of timeouts CAN'T BE LESS THAN THAT 2 "s client timeout=1000 ms, fallback timeout=700 ms, cache delay=0 ms"
SIZE="4"


# oscam init script(forse non seve perche script oscam restart????
#STARTSCRIPT="/etc/init.d/oscam"


# log file
LOG="/var/log/ipc/OScam.log"




CHECK="`tail -200 $LOG |grep -v grep |grep -c timeout`"


# If the the word "timeout" appears more times then SIZE ...
if [ "$CHECK" -gt "$SIZE" ]; then


# backup the log
#mv "$LOG" /var/log/oscamtimeout$(date '+%Y_%m_%d_%H:%M').log


# delete the log
rm "$LOG"
# logging restarts of oscam
echo 'oscam restarted becouse of timeot at' $(date '+%Y_%m_%d_%H:%M') >> /var/log/oscamtimeouts.log
#restart oscam
/var/emu/script/oscam restart



else
echo 'nincs' > /dev/null
exit 1
fi

dovrei dare permessi 775????
poi dovrei aggiungere una linea a i jobs e inserire la posizione del file (giusto????)
e per dare il comando che deve stare sempre attivo cosa metto nei prmi punti??

grazie ancora
 
Zuletzt bearbeitet von einem Moderator:
AW: script di controllo

se per esempio metto check.sh in /var/emu/script/check.sh
in i jobs va :
* * * * * root /var/emu/script/check.sh (se lo voglio sempre attivo???)
2 * * * * root /var/emu/script/check.sh (se voglio che si attivi ogni 2 minuti????? )
ecc
ecc

ho capito bene come inserire gli script ed aggiungerli su i jobs??? PLEASE!!!!
 
AW: script di controllo

raga nessuno mi sa rispondere?????
io ho provato ma per aiutare un po tutti sarebbe giusto ricevere una risposta dai piu esperti!!!!
:wacko1:
 
AW: script di controllo

Ma perche non usi il script che e gia integrato nel IPC?

Gesendet von meinem GT-I9300 mit Tapatalk 2
 
Für die Nutzung dieser Website sind Cookies erforderlich. Du musst diese akzeptieren, um die Website weiter nutzen zu können. Erfahre mehr…