Welcome!

Welcome to Satlover forums, full of great people, ideas and excitement.

Please register if you would like to take part. link..

Register Now

Alert: Don't Use Hotmail Email Accounts for registration

Collapse

Before Access to all Forums and Trial accounts you must need to activate your account Email address

Oscam full monitor script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • uttnls
    • Dec 2024

    Oscam full monitor script

    This is a script for monitoring :

    1. If Oscam process running
    2. If warnings were found in Oscam log
    3. If panics were found in Oscam log

    Shortly a full monitor script.

    In oscam config is mandatory to activate logfile option

    oscam-check.sh v0.1

    Code:
    #!/bin/bash
    
    oscamlog="/var/oscam/oscam.log"
    logfile="/var/oscam/oscam-check.log"
    oscampath="/var/oscam/oscam"
    oscamstart_cmd="/var/oscam/oscam -b -c /var/oscam"
    warning_limit="1"
    panic_limit="1"
    
    if [ $(ps -A | grep -c oscam) = 0 ]; then
    echo "$(date) Starting Oscam" >> $logfile
    $oscamstart_cmd
    fi
    
    if [ $(grep -c WARNING $oscamlog) -gt $warning_limit ]; then
    echo "$(date) Warning Detected - Stoping Oscam" >> $logfile
    grep -c WARNING $oscamlog >> $logfile
    killall -9 oscam
    cp $oscamlog $oscamlog".failed"
    cat /dev/null > $oscamlog
    sleep 2
    echo "$(date) Oscam started after WARNING" >> $logfile
    $oscamstart_cmd
    fi
    
    if [ $(grep -c PANIC $oscamlog) -gt $panic_limit ]; then
    echo "$(date)  PANIC Detected - Stoping Oscam " >> $logfile
    grep -c PANIC $oscamlog >> $logfile
    killall -9 oscam
    cp $oscamlog $oscamlog".failed"
    cat /dev/null > $oscamlog
    sleep 2
    echo "$(date) Oscam started after PANIC" >> $logfile
    $oscamstart_cmd
    fi
    Just change the variables at the beggining and should work just fine, put this in crontab to run every minute.

    If you have further questions just post them here
  • cro69
    Newbie
    • Sep 2010
    • 4

    #2
    Re: Oscam full monitor script

    where would i put this file in a vu+duo?

    Comment

    • uttnls

      #3
      Re: Oscam full monitor script

      Originally posted by cro69
      where would i put this file in a vu+duo?
      Is designed for a linux PC, if you want to use it in Vu+Duo is quite complicated.

      Depending on the image, go to your scripts folder, /var/scripts and put this script in that location.

      After that, edit your crontab to run the script at 5 minutes interval (or 10 or 1, as you wish)

      Don't forget to activate logfile in oscam.conf

      That's all, never tested on vuduo but it should work

      Comment

      Working...