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.

CCcam auf debian5 mit watchdog, traffic stats, CCcamInfo, fail2ban und webmin

    Nobody is reading this thread right now.
AW: CCcam auf debian5 mit watchdog, traffic stats, CCcamInfo, fail2ban und webmin

naja den hostname von deinem Debian rechner den kenne ich nicht

der NAME von deine Computer
 
AW: CCcam auf debian5 mit watchdog, traffic stats, CCcamInfo, fail2ban und webmin

immer dieses fachchinesich... :wacko1::wacko1::wacko1:

sag doch eionfach computername...:smoke::smoke:

danke....

gruß gianni
 
AW: CCcam auf debian5 mit watchdog, traffic stats, CCcamInfo, fail2ban und webmin

ich habe es auf deinen Wunsch geändert, sodass jeder bescheid weiß.. :~#
 
Zuletzt bearbeitet von einem Moderator:
/emu/script/cccam

Das Script /emu/script/cccam hat eine grausame Unschönheit, auch im wo es eigentlich her kommt.

zb. wenn der Befehl:

Code:
cccam miregal
eingegeben wird, stoppt CCcam ! (das will eigentlich niemand mit einem Schreibfehler erreichen) :fie:

Besser ist es zb. so:
Code:
#!/bin/sh
CAMNAME="CCcam Server"
# end
 
# CCcam Start
start_cam ()
  {
  timestamp=`date +"%Y%m%d_%H%M"`
  if [ -f /var/log/syslog ]
    then
    mv /var/log/syslog /var/log/CCcam-Restart-$timestamp.log
  fi
  /emu/cccam/CCcam.x86 -v -t & #logged CCcam Messages in SYSLOG !
  }
 
# CCcam Stop
stop_cam ()
  {
    pkill CCcam.x86
  }
case "$1" in
  start)
    echo "$1: $CAMNAME"
    start_cam
  ;;
 
  stop)
    echo "$1: $CAMNAME"
    stop_cam
  ;;
 
  restart)
    echo "Restarting $CAMNAME"
    stop_cam
    start_cam
  ;;
 
  status)
    echo "$CAMNAME Info"
    /emu/script/cccam-status.sh
  ;;
  backup)
    echo "$CAMNAME Backup"
    /emu/script/cccam-backup.sh
  ;;
 
  *)
    echo "Commands: cccam {start|stop|restart} {status|backup}" >&2
    exit 1
  ;;
 
esac
 
exit 0

wichtig der Absatz ab "*)", hier wird dann nur ein Hilfetext ausgegeben und CCcam NICHT gestoppt, nur mit dem Befehl "cccam stop".

Das Script ist aber generell anders aufgebaut, logt ins Debian SYSLOG was sowieso schon rotiert, auf dieses habe ich einen Filter gesetzt, das mir zb. unerlaubte Zugriffe logt usw...(ich will das so weil hier NUR CCcam läuft auf diesem System, auf einem WWW-Server ist das sicher nicht der richtige Weg...). Ausserdem wird das LOG wegkopiert, falls CCcam mal "crasht" und ich nachsehen möchte warum das so war.

Beispiel für das /emu/script/cccam-backup.sh:
(Sichert die CCcam.cfg, CCcam.providers, CCcam.channelinfo weg)

Code:
#!/bin/sh
#Backup the exist CCcam.cfg
SOURCE1=/var/etc
SOURCE2=/var/keys
FILE1=CCcam.cfg
FILE2=CCcam.channelinfo
FILE3=CCcam.providers
BACKUPDIR=/var/backups
MOUNTPATH=/mnt/backup
SHARE=//winsrv/sicherungen/CCcam
USER=vdr
PASS=linux
 
TIMESTAMP=`date +"%Y%m%d_%H%M"`
 
if test -f $SOURCE1/$FILE1 ; then
  echo " Local Backup"
    if test -d $BACKUPDIR ; then
      cp $SOURCE1/$FILE1 $BACKUPDIR/$FILE1-$TIMESTAMP
      cp $SOURCE2/$FILE2 $BACKUPDIR/$FILE2-$TIMESTAMP
      cp $SOURCE2/$FILE3 $BACKUPDIR/$FILE3-$TIMESTAMP
      echo " Backup has created in -> $BACKUPDIR/$FILE1-$TIMESTAMP"
      echo " Backup has created in -> $BACKUPDIR/$FILE2-$TIMESTAMP"
      echo " Backup has created in -> $BACKUPDIR/$FILE3-$TIMESTAMP"
 
      echo ""
      echo " Remote Backup (Windows Share)"
      # Mount des Windowsshare
      mount -t smbfs -o username=$USER,password=$PASS, $SHARE $MOUNTPATH
     # Kopiere Dateien auf Backupserver
      cp $SOURCE1/$FILE1 $MOUNTPATH/$FILE1-$TIMESTAMP
      cp $SOURCE2/$FILE2 $MOUNTPATH/$FILE2-$TIMESTAMP
      cp $SOURCE2/$FILE3 $MOUNTPATH/$FILE3-$TIMESTAMP
      echo " Backup has created in -> $SHARE/$FILE1-$TIMESTAMP"
      echo " Backup has created in -> $SHARE/$FILE2-$TIMESTAMP"
      echo " Backup has created in -> $SHARE/$FILE3-$TIMESTAMP"
      # UMount
      umount $MOUNTPATH
    else
      echo " Backup directory does not exist, Create this !"
    fi
else
  echo " $FILE1 not exist in $SOURCE1, is this Path ok ?"
fi
 
echo "Finish"
 
exit

mfg
 
Zuletzt bearbeitet:
Status

wer auch auf Commandebene einen "Status" sehen möchte,
hier ein Beispiel:

Die Infos werden von der HTML-Seite des CCcam geholt, also bitte "Port, User und Pass" im Script anpassen, das Script gehört dann nach /emu/script/cccam-status.sh (chmod 755).
Und natürlich muss der Befehl "status" im /emu/script/cccam eingetragen sein, siehe ein Beitrag zuvor...

Code:
#!/bin/sh
# set -x
WEBUSER="cccam"
WEBPASS="password"
URL=192.168.178.1
PORT="16001"
tmpfile="/tmp/cccam.001"
tmpfile2="/tmp/cccam.002"
PID="$(pgrep -x CCcam.x86)"
PID2="$(pidof CCcam.x86)"
PID3="$(pidof CCcam.x86 | wc -w)"
DVB_CARDS=$(ls -l /dev/dvb 2>/dev/null | grep adapter | wc -l)
WUP=""
[ "$WEBUSER" != "" ] && WUP="$WEBUSER:$WEBPASS@"
rm -f /tmp/cccam.0*
if [[ ! -z $PID ]] ; then
  echo "" >> $tmpfile
  echo "$(date)" >> $tmpfile
  echo "" >> $tmpfile
  wget -q -O - "[URL]http://$WUP$URL:$PORT[/URL]" | grep "Welcome"  | sed 's/^.*\(Welcome to CCcam [0-9.]* server\).*$/\1/' >> $tmpfile
  echo "" >> $tmpfile
  echo "DVB Cards:  $DVB_CARDS" >> $tmpfile
  echo "Running CCcams:  ${PID3}" >> $tmpfile
  echo "Process ID:  ${PID2}" >> $tmpfile
  else
 echo "CCcam ist nicht gestartet"
 exit
fi
   
wget -q -O - "[URL]http://$WUP$URL:$PORT[/URL]" | while
  true
  do
    read line         
    upTime=${line#*Uptime:*}
    echo "Uptime:"$upTime >> $tmpfile
    break
  done
  
echo "" >> $tmpfile
echo "-----------------------------------------------" >> $tmpfile
echo "Shareinfo:" >> $tmpfile
echo "" >> $tmpfile
wget -q -O - "[URL]http://$WUP$URL:$PORT/shares[/URL]" | while
 true
   do
    read line
    read line
    echo $line >> $tmpfile
    break
   done
   
echo "" >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep CCcam-s2s | cut -f 2,7 -d "|" > $tmpfile2
sed -e 's/|/ Cards: /g' $tmpfile2  >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep newcamd | cut -f 2,7 -d "|" > $tmpfile2
sed -e 's/|/ Cards: /g' $tmpfile2  >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep camd3 | cut -f 2,7 -d "|" > $tmpfile2
sed -e 's/|/ Cards: /g' $tmpfile2  >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep radegast | cut -f 2,7 -d "|" > $tmpfile2
sed -e 's/|/ Cards: /g' $tmpfile2  >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep gbox | cut -f 2,7 -d "|" > $tmpfile2
sed -e 's/|/ Cards: /g' $tmpfile2  >> $tmpfile
echo "" >> $tmpfile
echo "-----------------------------------------------" >> $tmpfile
echo "Serverinfo:" >> $tmpfile
echo "" >> $tmpfile
if [ $(wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -c CCcam-s2s) -ne 0 ] ; then  
  echo "CCcam-s2s:" >> $tmpfile
  echo "-----------" >> $tmpfile
  wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep CCcam-s2s | cut -f 2,3 -d "|" > $tmpfile2
  sed -e 's/|/   up: /g' $tmpfile2  >> $tmpfile
  echo "" >> $tmpfile
fi
  
if [ $(wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -c camd3) -ne 0 ] ; then  
  echo "camd3:" >> $tmpfile
  echo "-----------" >> $tmpfile
  wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep camd3 | cut -f 2,3 -d "|" > $tmpfile2
  sed -e 's/|/   up: /g' $tmpfile2  >> $tmpfile
  echo "" >> $tmpfile
fi
if [ $(wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -c gbox) -ne 0 ] ; then    
  echo "gbox:" >> $tmpfile
  echo "-----------" >> $tmpfile
  wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep gbox | cut -f 2,3 -d "|" > $tmpfile2
  sed -e 's/|/   up: /g' $tmpfile2  >> $tmpfile
  echo "" >> $tmpfile
fi
if [ $(wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -c newcamd) -ne 0 ] ; then  
  echo "newcamd:" >> $tmpfile
  echo "-----------" >> $tmpfile
  wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep newcamd | cut -f 2,3 -d "|" > $tmpfile2
  sed -e 's/|/   up: /g' $tmpfile2  >> $tmpfile
  echo "" >> $tmpfile
fi
if [ $(wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -c radegast) -ne 0 ] ; then  
  echo "Radegast:" >> $tmpfile
  echo "-----------" >> $tmpfile
  wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep radegast | cut -f 2,3 -d "|" > $tmpfile2
  sed -e 's/|/   up: /g' $tmpfile2  >> $tmpfile
  echo "" >> $tmpfile
fi
echo "-----------------------------------------------" >> $tmpfile
echo "Clientinfo:" >> $tmpfile
echo "" >> $tmpfile
wget -q -O - "[URL]http://$WUP$URL:$PORT[/URL]" | while
 true
  do
   read line
   read line
   connectedClients=${line#*<BR>*}
   echo $connectedClients >> $tmpfile
   read line
   activeClients=${line#*<BR>*}
   echo $activeClients >> $tmpfile  
   break
  done
echo "" >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/activeclients[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep 00d > $tmpfile2
cut -d\| -f2,3,9 $tmpfile2 | sed -e s/$/"\n"/g -e s/"|"/"\n"/2 -e s/"|"/" "/g >> $tmpfile
echo "-----------------------------------------------" >> $tmpfile
# echo "Client Connectinfo:" >> $tmpfile
# echo "" >> $tmpfile
# wget -O - "[URL]http://$WUP$URL:$PORT/clients[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep [.] | cut -d\| -f2,4,8 > $tmpfile2
# sed -e 's/|/    /g' $tmpfile2  >> $tmpfile
# echo "" >> $tmpfile
# echo "-----------------------------------------------" >> $tmpfile
cat $tmpfile
rm -f /tmp/cccam.0*

mfg
 
Watchdog Sendmail Beispiel:

Beispiel für Watchdog mit Senden eines E-Mails bei "CRASH".

Code:
#!/bin/sh
#set -x
#Functions
function SendEMail ()
{
  FROM="`hostname`@fqdn.net"
  TO="user[EMAIL="s@fqdn.net"]@fqdn.net[/EMAIL]"
  SMTP="mail.fqdn.net"
  BETREFF="CCcam Neustart :-("
  INHALT="CCcam Server musste neu gestartet werden."
 
  echo Sende Logdateien per E-Mail...
  sendEmail -f $FROM -t $TO -u $BETREFF -m $INHALT -s $SMTP
}
#MAIN
  timestamp=`date +"%Y-%m-%d %H:%M"`
  process=`ps auxwww | grep CCcam.x86 | grep -v grep | awk '{print $1}'`
if [ -z "$process" ]; then
  echo "$timestamp    ERROR CCcam Server musste neu gestartet werden :-(" >> /var/log/cccam.check
  cccam start
  SendEMail
else
  echo "$timestamp    OK    CCcam Server laeuft :-)" >> /var/log/cccam.check
fi
exit 0
 
Zuletzt bearbeitet:
AW: CCcam auf debian5 mit watchdog, traffic stats, CCcamInfo, fail2ban und webmin

Noch eine kleine Fehlermedlung im Fail2Ban bei mir:
Code:
 * Restarting authentication failure monitor fail2ban
* Socket file /var/run/fail2ban/fail2ban.sock is present        [fail]
Ist das in Ordnung, scheinbar wird Fail2Ban ja trotzdem gestartet :fie:
 
Zuletzt bearbeitet:
AW: CCcam auf debian5 mit watchdog, traffic stats, CCcamInfo, fail2ban und webmin

Muss nochmal nachfragen wegen folgender Fehlermeldung:
Code:
2009-08-27 18:40:47,153 fail2ban.server : ERROR  Unexpected communication error

Sicher ist der Hostname falsch?
Oder woran liegt das? :fie:
 
AW: CCcam auf debian5 mit watchdog, traffic stats, CCcamInfo, fail2ban und webmin

Watchdog einstellen und starten (Überprüft auf 2 arten ob CCcam läuft und startet diese ggf. neu)

User, Passwort und WEBIF Port editieren in /usr/bin/cccamwatchdog
(doppelklick in WinSCP)



4.1 Wir benutzen nocheinmal putty für watchdog autostart

Code:
update-rc.d cccamwatchdogd defaults 99

4.2 Und starten den Wachhund zuletzt:

Code:
/etc/init.d/cccamwatchdogd start

5. fail2ban einrichten, installieren und starten (Um ungebetene Gäste oder nicht mehr gültige Shares auszusperren)


mfg
k04l[/QUOTE]

hi Jungs wie kann ich watchdog einstellen und starten unter Ubuntu ( welche befehle, wo find ich den unter Programme )

was ist diese cccamwachtdogd ?

ich brauche bitte hilfe um alles hin zu kriegen mit befehle unter Ubuntu usw..

ich hab oooooooo Ahnung mit Linux

wäre super
Danke:fie:
 
AW: CCcam auf debian5 mit watchdog, traffic stats, CCcamInfo, fail2ban und webmin

hallo leute ! ich habe auch ein problem !! und zwar kann ich aus dem netzwerk heraus auf /stats und /cccam zugreifen ! aber über internet krieg ich es nicht zu gange ! welche ports muss ich da im router weiterleiten um auf das web interface zugriff zu bekommen ?
 
AW: CCcam auf debian5 mit watchdog, traffic stats, CCcamInfo, fail2ban und webmin

eignet sich auch so ein teil dafür ?



ob halt smargos erkannt werden ?
 
AW: CCcam auf debian5 mit watchdog, traffic stats, CCcamInfo, fail2ban und webmin

habt ihr smargos an dem teil am laufen ? andere cardreader ?

gruss
 
AW: CCcam auf debian5 mit watchdog, traffic stats, CCcamInfo, fail2ban und webmin



port 80 mein Freund, web
 
AW: CCcam auf debian5 mit watchdog, traffic stats, CCcamInfo, fail2ban und webmin

Jungs,
Könnte mir keine helfen wie ich Watchdog einstellen ( installiert hab ich schon ) oder mal sagen was genaue cccamwatchdogd ob auch eine Anwendung ist oder was anders

Danke

alles hin gekriegt trotzdem Danke

Nun hab ich dieses Probleme fail2ban mit was ist das für einen Fehler

2009-08-31 02:51:42,051 fail2ban.jail : INFO Jail 'ssh' started
2009-08-31 02:51:42,065 fail2ban.server : ERROR Unexpected communication errorge

gelöst danke

einfach die Python version in der Verzeichnis /usr/bin/fail2ban-server auf die neue python2.5

#!/usr/bin/python
--> to
#!/usr/bin/python2.5

falls Python nicht instaliert dann

#apt-get install python2.5

dann

# /etc/init.d/fail2ban restart

/var/log/fail2ban.log

2009-08-31 03:30:18,013 fail2ban.server : INFO Starting Fail2ban v0.8.3
2009-08-31 03:30:18,014 fail2ban.server : INFO Starting in daemon mode
2009-08-31 03:30:06,663 fail2ban.actions: INFO Set banTime = 6000
2009-08-31 03:30:06,688 fail2ban.jail : INFO Creating new jail 'ssh'
2009-08-31 03:30:06,688 fail2ban.jail : INFO Jail 'ssh' uses poller
2009-08-31 03:30:06,691 fail2ban.filter : INFO Added logfile = /var/log/auth.log
2009-08-31 03:30:06,694 fail2ban.filter : INFO Set maxRetry = 6
2009-08-31 03:30:06,698 fail2ban.filter : INFO Set findtime = 600
2009-08-31 03:30:06,700 fail2ban.actions: INFO Set banTime = 6000
2009-08-31 03:30:06,891 fail2ban.jail : INFO Jail 'cccam' started
2009-08-31 03:30:06,965 fail2ban.jail : INFO Jail 'ssh-ddos' started
2009-08-31 03:30:07,002 fail2ban.jail : INFO Jail 'ssh' started
 
Zuletzt bearbeitet:
Für die Nutzung dieser Website sind Cookies erforderlich. Du musst diese akzeptieren, um die Website weiter nutzen zu können. Erfahre mehr…