Watchdog (Oscam): Unterschied zwischen den Versionen

Aus Tutorials
Zur Navigation springen Zur Suche springen
 
(39 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
{{note|Noch in Bearbeitung}}
== verwandte Themen ==
 
Siehe auch: [[Startup-Scripte (Enigma2)|Startup-Scripte]], [[Mails versenden (Enigma2)|Mails versenden (Enigma2)]]
 
== OSCam Cardserver überwachen ==
 
Siehe [[Oscam Cardserver überwachen (Rapberry)|OSCam Cardserver überwachen]]
 
== OSCam Client-Verbindung überwachen ==
 
Siehe [[OSCam Client-Verbindung überwachen (Satreceiver)|OSCam Client-Verbindung überwachen]]


== verwandte Themen ==
== Receiver ==


Siehe auch: [[Startup-Scripte (Enigma2)|Startup-Scripte]]
=== Startscript ermitteln ===


== Raspberry ==
Der Befehl


{{note|Noch in Bearbeitung}}
<pre>
ls -la /etc/init.d/
</pre>


sollte einen Eintrag wie folgenden ausgeben:
<pre>
current_cam.sh -> /usr/script/oscam_1.20-unstable-11682_cam.sh
</pre>


=== PID ermitteln ===
=== PID ermitteln ===


<pre>
<pre>
pidof /usr/local/bin/oscam
pidof oscam_1.20-unstable-11682
</pre>
</pre>


Zeile 20: Zeile 36:


<pre>
<pre>
sudo vi /usr/local/bin/oscam_watchdog.sh
vi /usr/script/oscam_watchdog.sh
</pre>
</pre>
VTi Team Image (Receiver Hofstetten):


<pre>
<pre>
PIDFILE=/var/run/oscam.pid
#!/bin/bash
if (kill -0 `cat $PIDFILE`)
 
then
PID=$(pidof oscam_1.20-unstable-11682)
echo "it's alive!" >; /dev/null
if (kill -0 $PID 2>/dev/null)
else
then
rm $PIDFILE
  echo "it's alive!" > /dev/null
/usr/local/bin/oscam start > /dev/null
else
echo "OSCAM restarted at `date`" >> /var/log/oscam-crash.log
  /usr/script/oscam_1.20-unstable-11682_cam.sh restart > /dev/null
  echo "OSCAM restarted at `date +"'%d.%m.%Y %H:%M'"`" >> /tmp/crash-log-oscam.log
  echo -e "OSCAM of receiver-hofstetten restarted at `date +"'%d.%m.%Y %H:%M'"`" | /usr/bin/mailx -A kirner.or.at -s "OSCAM of receiver-hofstetten restarted" admin@kirner.or.at
fi
fi
</pre>
</pre>


== Receiver ==
OpenATV (Receiver Seestadt):


{{note|Noch in Bearbeitung}}
<pre>
#!/bin/bash


PID=$(pidof /usr/bin/oscam-trunk)
if (kill -0 $PID 2>/dev/null)
then
  echo "it's alive!" > /dev/null
else
  /etc/init.d/softcam.oscam-trunk restart > /dev/null
  echo "OSCAM restarted at `date +"'%d.%m.%Y %H:%M'"`" >> /tmp/crash-log-oscam.log
  echo -e "OSCAM of receiver-seestadt restarted at `date +"'%d.%m.%Y %H:%M'"`" | /usr/bin/mailx -A kirner.or.at -s "OSCAM of receiver-seestadt restarted" admin@kirner.or.at
fi
</pre>


=== Startscript ermitteln ===
<pre>
chmod +x /usr/script/oscam_watchdog.sh
</pre>


Der Befehl
=== Init-Script erstellen ===


<pre>
<pre>
ls -la /etc/init.d/
ln -sf /usr/script/oscam_watchdog.sh /etc/init.d/oscam_watchdog.sh
</pre>
</pre>
sollte einen Eintrag wie folgenden ausgeben:


<pre>
<pre>
current_cam.sh -> /usr/script/oscam_1.20-unstable-11682_cam.sh
cd /etc/rc3.d/
ln -sf ../init.d/oscam_watchdog.sh /etc/rc3.d/S99oscam_watchdog.sh
</pre>
</pre>
=== Links ===
[http://raspberry.tips/raspberrypi-tutorials/oscam-watchdog-fuer-den-raspberry-pi/ http://raspberry.tips/raspberrypi-tutorials/oscam-watchdog-fuer-den-raspberry-pi/]
== Raspberry ==
{{note|Noch in Bearbeitung}}


=== PID ermitteln ===
=== PID ermitteln ===


<pre>
<pre>
pidof oscam_1.20-unstable-11682
pidof /usr/local/bin/oscam
</pre>
</pre>


Zeile 63: Zeile 103:


<pre>
<pre>
vi /usr/script/oscam_watchdog.sh
sudo vi /usr/local/bin/oscam_watchdog.sh
</pre>
</pre>


<pre>
<pre>
PID=$(pidof oscam_1.20-unstable-11682)
#!/bin/bash
if (kill -0 $PID)
 
PIDFILE=/var/run/oscam.pid
if (kill -0 `cat $PIDFILE`)
  then
  then
  echo "it's alive!" >; /dev/null
  echo "it's alive!" > /dev/null
  else
  else
  /usr/script/oscam_1.20-unstable-11682_cam.sh restart > /dev/null
rm $PIDFILE
  echo "OSCAM restarted at `date`" >> /tmp/oscam-crash.log
  /usr/local/bin/oscam start > /dev/null
  echo "OSCAM restarted at `date`" >> /var/log/oscam-crash.log
fi
fi
</pre>
</pre>


<pre>
<pre>
chmod +x /usr/script/oscam_watchdog.sh
sudo chmod +x /usr/local/bin/oscam_watchdog.sh
</pre>
</pre>
=== Links ===
[http://raspberry.tips/raspberrypi-tutorials/oscam-watchdog-fuer-den-raspberry-pi/ http://raspberry.tips/raspberrypi-tutorials/oscam-watchdog-fuer-den-raspberry-pi/]




Zurück zu [[OSCam_(Raspberry)#Watchdog|OSCam_(Raspberry)]], [[OSCam_(Satreceiver)#Watchdog|OSCam_(Satreceiver)]]
Zurück zu [[OSCam_(Raspberry)#Watchdog|OSCam_(Raspberry)]], [[OSCam_(Satreceiver)#Watchdog|OSCam_(Satreceiver)]]

Aktuelle Version vom 4. Dezember 2023, 22:00 Uhr

verwandte Themen

Siehe auch: Startup-Scripte, Mails versenden (Enigma2)

OSCam Cardserver überwachen

Siehe OSCam Cardserver überwachen

OSCam Client-Verbindung überwachen

Siehe OSCam Client-Verbindung überwachen

Receiver

Startscript ermitteln

Der Befehl

ls -la /etc/init.d/

sollte einen Eintrag wie folgenden ausgeben:

current_cam.sh -> /usr/script/oscam_1.20-unstable-11682_cam.sh

PID ermitteln

pidof oscam_1.20-unstable-11682

Script

vi /usr/script/oscam_watchdog.sh

VTi Team Image (Receiver Hofstetten):

#!/bin/bash

PID=$(pidof oscam_1.20-unstable-11682)
if (kill -0 $PID 2>/dev/null)
then
  echo "it's alive!" > /dev/null
else
  /usr/script/oscam_1.20-unstable-11682_cam.sh restart > /dev/null
  echo "OSCAM restarted at `date +"'%d.%m.%Y %H:%M'"`" >> /tmp/crash-log-oscam.log
  echo -e "OSCAM of receiver-hofstetten restarted at `date +"'%d.%m.%Y %H:%M'"`" | /usr/bin/mailx -A kirner.or.at -s "OSCAM of receiver-hofstetten restarted" admin@kirner.or.at
fi

OpenATV (Receiver Seestadt):

#!/bin/bash

PID=$(pidof /usr/bin/oscam-trunk)
if (kill -0 $PID 2>/dev/null)
then
  echo "it's alive!" > /dev/null
else
  /etc/init.d/softcam.oscam-trunk restart > /dev/null
  echo "OSCAM restarted at `date +"'%d.%m.%Y %H:%M'"`" >> /tmp/crash-log-oscam.log
  echo -e "OSCAM of receiver-seestadt restarted at `date +"'%d.%m.%Y %H:%M'"`" | /usr/bin/mailx -A kirner.or.at -s "OSCAM of receiver-seestadt restarted" admin@kirner.or.at
fi
chmod +x /usr/script/oscam_watchdog.sh

Init-Script erstellen

ln -sf /usr/script/oscam_watchdog.sh /etc/init.d/oscam_watchdog.sh
cd /etc/rc3.d/
ln -sf ../init.d/oscam_watchdog.sh /etc/rc3.d/S99oscam_watchdog.sh

Links

http://raspberry.tips/raspberrypi-tutorials/oscam-watchdog-fuer-den-raspberry-pi/

Raspberry

Noch in Bearbeitung

PID ermitteln

pidof /usr/local/bin/oscam

Script

sudo vi /usr/local/bin/oscam_watchdog.sh
#!/bin/bash

PIDFILE=/var/run/oscam.pid
if (kill -0 `cat $PIDFILE`)
 then
 echo "it's alive!" > /dev/null
 else
 rm $PIDFILE
 /usr/local/bin/oscam start > /dev/null
 echo "OSCAM restarted at `date`" >> /var/log/oscam-crash.log
fi
sudo chmod +x /usr/local/bin/oscam_watchdog.sh


Zurück zu OSCam_(Raspberry), OSCam_(Satreceiver)