Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

Notification of conflicts

 

 

First page Previous page 1 2 Next page Last page  View All MythTV users RSS feed   Index | Next | Previous | View Threaded


richard.e.morton at gmail

Sep 13, 2009, 7:21 AM

Post #1 of 27 (1589 views)
Permalink
Notification of conflicts

Hi,

Now the Mythbox has come into very regular use with the other half,
the number of programmes being recorded has trebled and so we're now
getting conflicts.

Is there a script, plugin or option for Myth that notifies you (via
email?) of a conflict. This app could be triggered on each new
recording schedule modification / schedule update so that you're
notified each time the scheduling information changes, or on a crontab
task.

A simple email with links into mythweb to show the conflict issue
would be nice; but a notification that there are conflicts to review
would be sufficient.

If it doesn't exist I would be interested in writing something like
this however; Although it shouldnt be too hard to create something
like this in php or python I know the scheduling engine is quite
complex so I doubt a simple SQL query would be sufficient.

So does this sort of thing already exist?

thanks

Rich
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


steve at heistand

Sep 13, 2009, 7:43 AM

Post #2 of 27 (1540 views)
Permalink
Re: Notification of conflicts [In reply to]

Richard Morton <richard.e.morton [at] gmail>, said on Sun Sep 13, 2009 [03:21:17 PM]:
} Hi,
}
} Now the Mythbox has come into very regular use with the other half,
} the number of programmes being recorded has trebled and so we're now
} getting conflicts.
}
} Is there a script, plugin or option for Myth that notifies you (via
} email?) of a conflict. This app could be triggered on each new
} recording schedule modification / schedule update so that you're
} notified each time the scheduling information changes, or on a crontab
} task.
}
} A simple email with links into mythweb to show the conflict issue
} would be nice; but a notification that there are conflicts to review
} would be sufficient.
}
} If it doesn't exist I would be interested in writing something like
} this however; Although it shouldnt be too hard to create something
} like this in php or python I know the scheduling engine is quite
} complex so I doubt a simple SQL query would be sufficient.
}
} So does this sort of thing already exist?
}
} thanks
}
} Rich
} _______________________________________________


I run this once a day from cron:

#!/bin/csh

set result=`/usr/local/src/myth_trunk/mythtv/contrib/info/misc_status_info/myth_upcoming_recordings.pl --recordings -1 --no_show_scheduled --plain_text --heading '<h3>Recording Conflicts</h3>' `
# --no_conflicts_message 'No\n' `

if ( "$result" != "No conflicts." ) then
echo "$result" | Mail -s "Mythtv recording conflict" heistand >& /dev/null
endif

--
"Why is it so hot inside this handbasket?"
--
Steve Heistand
steve [at] heistand
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


andrew.allison at gmail

Sep 14, 2009, 10:11 AM

Post #3 of 27 (1526 views)
Permalink
Re: Notification of conflicts [In reply to]

On Sun, 2009-09-13 at 07:43 -0700, Steve Heistand wrote:
> Richard Morton <richard.e.morton [at] gmail>, said on Sun Sep 13, 2009 [03:21:17 PM]:
> } Hi,
> }
> } Now the Mythbox has come into very regular use with the other half,
> } the number of programmes being recorded has trebled and so we're now
> } getting conflicts.
> }
> } Is there a script, plugin or option for Myth that notifies you (via
> } email?) of a conflict. This app could be triggered on each new
> } recording schedule modification / schedule update so that you're
> } notified each time the scheduling information changes, or on a crontab
> } task.
> }
> } A simple email with links into mythweb to show the conflict issue
> } would be nice; but a notification that there are conflicts to review
> } would be sufficient.
> }
> } If it doesn't exist I would be interested in writing something like
> } this however; Although it shouldnt be too hard to create something
> } like this in php or python I know the scheduling engine is quite
> } complex so I doubt a simple SQL query would be sufficient.
> }
> } So does this sort of thing already exist?
> }
> } thanks
> }
> } Rich
> } _______________________________________________
>
>
> I run this once a day from cron:
>
> #!/bin/csh
>
> set result=`/usr/local/src/myth_trunk/mythtv/contrib/info/misc_status_info/myth_upcoming_recordings.pl --recordings -1 --no_show_scheduled --plain_text --heading '<h3>Recording Conflicts</h3>' `
> # --no_conflicts_message 'No\n' `
>
> if ( "$result" != "No conflicts." ) then
> echo "$result" | Mail -s "Mythtv recording conflict" heistand >& /dev/null
> endif
>
This got me to thinking.

I've dug out one of my old script files and come up with this.
Problem is I can't get the report into the message body,so I've had to
stick into the subject line.

Can anybody spot what I've done wrong to get the report into the message
body.

I've sanitized the user name and email domains and echo (echo "HELO is
one continuous line.


!/bin/bash
result=`/usr/share/doc/mythtv-docs-0.21/contrib/misc_status_info/myth_upcoming_recordings.pl --recordings -1 --no_show_scheduled --plain_text --heading '<h3>Recording Conflicts</h3>'`

if [ "$result" != "No conflicts." ]
then
echo "Conflict"
rm /home/mythtv/conflict.report
#
echo -n "Date:" > /home/mythtv/conflict.report
/bin/date >> /home/mythtv/conflict.report
echo "From:user [at] domain" >> /home/mythtv/conflict.report
echo "To:user [at] domain" >> /home/mythtv/conflict.report
echo -n "Subject:Mythtv Conflict" >> /home/mythtv/conflict.report
echo $result >> /home/mythtv/conflict.report
(echo "HELO domain.com"; sleep 2; echo "MAIL From:user [at] domain";
sleep 2; echo "RCPT To:user [at] domain"; sleep 2; echo "DATA"; sleep
2; /bin/cat /home/mythtv/conflict.report; sleep 2; echo "."; sleep 2;
echo "QUIT"; sleep 2; ) | telnet smtp.domain.com 25
fi

~



_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


redpepperracing at gmail

Sep 14, 2009, 10:19 AM

Post #4 of 27 (1537 views)
Permalink
Re: Notification of conflicts [In reply to]

On Mon, Sep 14, 2009 at 1:11 PM, Andrew Allison
<andrew.allison [at] gmail> wrote:
> On Sun, 2009-09-13 at 07:43 -0700, Steve Heistand wrote:
>> Richard Morton <richard.e.morton [at] gmail>, said on Sun Sep 13, 2009 [03:21:17 PM]:
>> } Hi,
>> }
>> } Now the Mythbox has come into very regular use with the other half,
>> } the number of programmes being recorded has trebled and so we're now
>> } getting conflicts.
>> }
>> } Is there a script, plugin or option for Myth that notifies you (via
>> } email?) of a conflict. This app could be triggered on each new
>> } recording schedule modification / schedule update so that you're
>> } notified each time the scheduling information changes, or on a crontab
>> } task.
>> }
>> } A simple email with links into mythweb to show the conflict issue
>> } would be nice; but a notification that there are conflicts to review
>> } would be sufficient.
>> }
>> } If it doesn't exist I would be interested in writing something like
>> } this however; Although it shouldnt be too hard to create something
>> } like this in php or python I know the scheduling engine is quite
>> } complex so I doubt a simple SQL query would be sufficient.
>> }
>> } So does this sort of thing already exist?
>> }
>> } thanks
>> }
>> } Rich
>> } _______________________________________________
>>
>>
>> I run this once a day from cron:
>>
>> #!/bin/csh
>>
>> set result=`/usr/local/src/myth_trunk/mythtv/contrib/info/misc_status_info/myth_upcoming_recordings.pl --recordings -1 --no_show_scheduled --plain_text --heading '<h3>Recording Conflicts</h3>' `
>> #                           --no_conflicts_message 'No\n' `
>>
>> if ( "$result" != "No conflicts." ) then
>>   echo "$result" | Mail -s "Mythtv recording conflict" heistand >& /dev/null
>> endif
>>
> This got me to thinking.
>
> I've dug out one of my old script files and come up with this.
> Problem is I can't get the report into the message body,so I've had to
> stick into the subject line.
>
> Can anybody spot what I've done wrong to get the report into the message
> body.
>
> I've sanitized the user name and email domains and echo (echo "HELO is
> one continuous line.
>
>
> !/bin/bash
> result=`/usr/share/doc/mythtv-docs-0.21/contrib/misc_status_info/myth_upcoming_recordings.pl --recordings -1 --no_show_scheduled --plain_text --heading '<h3>Recording Conflicts</h3>'`
>
> if [ "$result" != "No conflicts." ]
> then
>    echo "Conflict"
>    rm /home/mythtv/conflict.report
> #
>    echo -n "Date:" > /home/mythtv/conflict.report
>    /bin/date >> /home/mythtv/conflict.report
>    echo "From:user [at] domain" >> /home/mythtv/conflict.report
>    echo "To:user [at] domain"   >> /home/mythtv/conflict.report
>    echo -n "Subject:Mythtv Conflict"  >> /home/mythtv/conflict.report
>    echo $result >> /home/mythtv/conflict.report
>    (echo "HELO domain.com"; sleep 2; echo "MAIL From:user [at] domain";
> sleep 2; echo "RCPT To:user [at] domain"; sleep 2; echo "DATA"; sleep
> 2; /bin/cat /home/mythtv/conflict.report; sleep 2; echo "."; sleep 2;
> echo "QUIT"; sleep 2; ) | telnet smtp.domain.com 25
> fi

Wouldn't it just be easier to install the mail command?

Regardless, this should work better:

(echo "HELO domain.com"; sleep 2; echo "MAIL From:user [at] domain";
sleep 2; echo "RCPT To:user [at] domain"; sleep 2; echo "DATA"; sleep
2; echo "Subject: MythTV recording conflict" ; sleep 2 ; echo "From:
user [at] domain" ; sleep 2 ; echo "To: user [at] domain" ; sleep 2 ;
/bin/cat /home/mythtv/conflict.report; sleep 2; echo "."; sleep 2;
echo "QUIT"; sleep 2; )

Tom
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


andrew.allison at gmail

Sep 14, 2009, 10:30 AM

Post #5 of 27 (1516 views)
Permalink
Re: Notification of conflicts [In reply to]

On Mon, 2009-09-14 at 13:19 -0400, Tom Lichti wrote:
> On Mon, Sep 14, 2009 at 1:11 PM, Andrew Allison
> <andrew.allison [at] gmail> wrote:
> > On Sun, 2009-09-13 at 07:43 -0700, Steve Heistand wrote:
> >> Richard Morton <richard.e.morton [at] gmail>, said on Sun Sep 13, 2009 [03:21:17 PM]:
> >> } Hi,
> >> }
> >> } Now the Mythbox has come into very regular use with the other half,
> >> } the number of programmes being recorded has trebled and so we're now
> >> } getting conflicts.
> >> }
> >> } Is there a script, plugin or option for Myth that notifies you (via
> >> } email?) of a conflict. This app could be triggered on each new
> >> } recording schedule modification / schedule update so that you're
> >> } notified each time the scheduling information changes, or on a crontab
> >> } task.
> >> }
> >> } A simple email with links into mythweb to show the conflict issue
> >> } would be nice; but a notification that there are conflicts to review
> >> } would be sufficient.
> >> }
> >> } If it doesn't exist I would be interested in writing something like
> >> } this however; Although it shouldnt be too hard to create something
> >> } like this in php or python I know the scheduling engine is quite
> >> } complex so I doubt a simple SQL query would be sufficient.
> >> }
> >> } So does this sort of thing already exist?
> >> }
> >> } thanks
> >> }
> >> } Rich
> >> } _______________________________________________
> >>
> >>
> >> I run this once a day from cron:
> >>
> >> #!/bin/csh
> >>
> >> set result=`/usr/local/src/myth_trunk/mythtv/contrib/info/misc_status_info/myth_upcoming_recordings.pl --recordings -1 --no_show_scheduled --plain_text --heading '<h3>Recording Conflicts</h3>' `
> >> # --no_conflicts_message 'No\n' `
> >>
> >> if ( "$result" != "No conflicts." ) then
> >> echo "$result" | Mail -s "Mythtv recording conflict" heistand >& /dev/null
> >> endif
> >>
> > This got me to thinking.
> >
> > I've dug out one of my old script files and come up with this.
> > Problem is I can't get the report into the message body,so I've had to
> > stick into the subject line.
> >
> > Can anybody spot what I've done wrong to get the report into the message
> > body.
> >
> > I've sanitized the user name and email domains and echo (echo "HELO is
> > one continuous line.
> >
> >
> > !/bin/bash
> > result=`/usr/share/doc/mythtv-docs-0.21/contrib/misc_status_info/myth_upcoming_recordings.pl --recordings -1 --no_show_scheduled --plain_text --heading '<h3>Recording Conflicts</h3>'`
> >
> > if [ "$result" != "No conflicts." ]
> > then
> > echo "Conflict"
> > rm /home/mythtv/conflict.report
> > #
> > echo -n "Date:" > /home/mythtv/conflict.report
> > /bin/date >> /home/mythtv/conflict.report
> > echo "From:user [at] domain" >> /home/mythtv/conflict.report
> > echo "To:user [at] domain" >> /home/mythtv/conflict.report
> > echo -n "Subject:Mythtv Conflict" >> /home/mythtv/conflict.report
> > echo $result >> /home/mythtv/conflict.report
> > (echo "HELO domain.com"; sleep 2; echo "MAIL From:user [at] domain";
> > sleep 2; echo "RCPT To:user [at] domain"; sleep 2; echo "DATA"; sleep
> > 2; /bin/cat /home/mythtv/conflict.report; sleep 2; echo "."; sleep 2;
> > echo "QUIT"; sleep 2; ) | telnet smtp.domain.com 25
> > fi
>
> Wouldn't it just be easier to install the mail command?

I'm guessing it's the account option. I don't want to know which decade
they slipped that one in.
>
> Regardless, this should work better:
>
> (echo "HELO domain.com"; sleep 2; echo "MAIL From:user [at] domain";
> sleep 2; echo "RCPT To:user [at] domain"; sleep 2; echo "DATA"; sleep
> 2; echo "Subject: MythTV recording conflict" ; sleep 2 ; echo "From:
> user [at] domain" ; sleep 2 ; echo "To: user [at] domain" ; sleep 2 ;
> /bin/cat /home/mythtv/conflict.report; sleep 2; echo "."; sleep 2;
> echo "QUIT"; sleep 2; )
>
>
I guess you can be too old school sometimes.

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


support at drdos

Sep 14, 2009, 11:03 AM

Post #6 of 27 (1516 views)
Permalink
Re: Notification of conflicts [In reply to]

Andrew Allison wrote:
>
> I guess you can be too old school sometimes.
>

*snicker*

Doug

--

Ben Franklin quote:

"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


richard.e.morton at gmail

Sep 14, 2009, 12:46 PM

Post #7 of 27 (1510 views)
Permalink
Re: Notification of conflicts [In reply to]

Hi There,

WOW - what a response. Thanks for all the help... I am however falling
at the first hurdle... I cant find the script

/usr/share/doc/mythtv-docs-0.21/contrib/misc_status_info/myth_upcoming_recordings.pl

I dont have a directory mythtv-docs-0.21

I do have mythtv-docs, but doesn't contain the contrib dir.

I have pretty much everything installed according to synaptic (running
Mythbuntu 904). Anyideas how I get these (very useful looking)
scripts.

Thanks for your help again.

R



2009/9/14 Doug Lytle <support [at] drdos>:
> Andrew Allison wrote:
>>
>> I guess you can be too old school sometimes.
>>
>
> *snicker*
>
> Doug
>
> --
>
> Ben Franklin quote:
>
> "Those who would give up Essential Liberty to purchase a little Temporary
> Safety, deserve neither Liberty nor Safety."
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


support at drdos

Sep 14, 2009, 12:52 PM

Post #8 of 27 (1502 views)
Permalink
Re: Notification of conflicts [In reply to]

Richard Morton wrote:
> Hi There,
>
> WOW - what a response. Thanks for all the help... I am however falling
> at the first hurdle... I cant find the script
>
> /usr/share/doc/mythtv-docs-0.21/contrib/misc_status_info/myth_upcoming_recordings.pl
>

Try the following as root or use sudo if necessary

updatedb
locate myth_upcoming_recordings.pl.

This should update the locate database and the locate command will tell
you were it is.


Doug


--

Ben Franklin quote:

"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


greg at gregandeva

Sep 14, 2009, 1:12 PM

Post #9 of 27 (1514 views)
Permalink
Re: Notification of conflicts [In reply to]

On Mon, 2009-09-14 at 13:11 -0400, Andrew Allison wrote:

> I've dug out one of my old script files and come up with this.
> Problem is I can't get the report into the message body,so I've had to
> stick into the subject line.

You need to make sure there is a blank line between the last header and
the beginning of the message body (after your Subject header).

--Greg


_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


richard.e.morton at gmail

Sep 14, 2009, 1:18 PM

Post #10 of 27 (1508 views)
Permalink
Re: Notification of conflicts [In reply to]

Thanks Doug,

found it; you're a star

R



2009/9/14 Doug Lytle <support [at] drdos>:
> Richard Morton wrote:
>>
>> Hi There,
>>
>> WOW - what a response. Thanks for all the help... I am however falling
>> at the first hurdle... I cant find the script
>>
>>
>> /usr/share/doc/mythtv-docs-0.21/contrib/misc_status_info/myth_upcoming_recordings.pl
>>
>
> Try the following as root or use sudo if necessary
>
> updatedb
> locate myth_upcoming_recordings.pl.
>
> This should update the locate database and the locate command will tell you
> were it is.
>
>
> Doug
>
>
> --
>
> Ben Franklin quote:
>
> "Those who would give up Essential Liberty to purchase a little Temporary
> Safety, deserve neither Liberty nor Safety."
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


stichnot at gmail

Sep 14, 2009, 1:20 PM

Post #11 of 27 (1501 views)
Permalink
Re: Notification of conflicts [In reply to]

On Mon, Sep 14, 2009 at 12:52 PM, Doug Lytle <support [at] drdos> wrote:
> Richard Morton wrote:
>>
>> Hi There,
>>
>> WOW - what a response. Thanks for all the help... I am however falling
>> at the first hurdle... I cant find the script
>>
>>
>> /usr/share/doc/mythtv-docs-0.21/contrib/misc_status_info/myth_upcoming_recordings.pl
>>
>
> Try the following as root or use sudo if necessary
>
> updatedb
> locate myth_upcoming_recordings.pl.
>
> This should update the locate database and the locate command will tell you
> were it is.
>
>
> Doug

If you still have problems finding the perl script or getting it to
run, you could always try "mythbackend --printsched". Conflicts will
be indicated by a "C" character in the column labeled "N". Unless the
formatting of --printsched has changed, this command should work:

mythbackend --printsched | awk '/^Title -
Subtitle/||substr($0,70,1)=="C"{print}'

Jim
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


redpepperracing at gmail

Sep 14, 2009, 1:23 PM

Post #12 of 27 (1511 views)
Permalink
Re: Notification of conflicts [In reply to]

On Mon, Sep 14, 2009 at 4:12 PM, Greg Woods <greg [at] gregandeva> wrote:
> On Mon, 2009-09-14 at 13:11 -0400, Andrew Allison wrote:
>
>> I've dug out one of my old script files and come up with this.
>> Problem is I can't get the report into the message body,so I've had to
>> stick into the subject line.
>
> You need to make sure there is a blank line between the last header and
> the beginning of the message body (after your Subject header).

Nope, works just fine without a blank line. His problem is that he
doesn't have any headers, so if he adds them like I posted earlier, it
should work.

Tom
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


nick.rout at gmail

Sep 14, 2009, 2:06 PM

Post #13 of 27 (1499 views)
Permalink
Re: Notification of conflicts [In reply to]

On Tue, Sep 15, 2009 at 8:23 AM, Tom Lichti <redpepperracing [at] gmail> wrote:
> On Mon, Sep 14, 2009 at 4:12 PM, Greg Woods <greg [at] gregandeva> wrote:
>> On Mon, 2009-09-14 at 13:11 -0400, Andrew Allison wrote:
>>
>>> I've dug out one of my old script files and come up with this.
>>> Problem is I can't get the report into the message body,so I've had to
>>> stick into the subject line.
>>
>> You need to make sure there is a blank line between the last header and
>> the beginning of the message body (after your Subject header).
>
> Nope, works just fine without a blank line. His problem is that he
> doesn't have any headers, so if he adds them like I posted earlier, it
> should work.

but as someone said, mail (or mailx) would work so much easier...
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


redpepperracing at gmail

Sep 14, 2009, 3:07 PM

Post #14 of 27 (1507 views)
Permalink
Re: Notification of conflicts [In reply to]

On Mon, Sep 14, 2009 at 5:06 PM, Nick Rout <nick.rout [at] gmail> wrote:
> On Tue, Sep 15, 2009 at 8:23 AM, Tom Lichti <redpepperracing [at] gmail> wrote:
>> On Mon, Sep 14, 2009 at 4:12 PM, Greg Woods <greg [at] gregandeva> wrote:
>>> On Mon, 2009-09-14 at 13:11 -0400, Andrew Allison wrote:
>>>
>>>> I've dug out one of my old script files and come up with this.
>>>> Problem is I can't get the report into the message body,so I've had to
>>>> stick into the subject line.
>>>
>>> You need to make sure there is a blank line between the last header and
>>> the beginning of the message body (after your Subject header).
>>
>> Nope, works just fine without a blank line. His problem is that he
>> doesn't have any headers, so if he adds them like I posted earlier, it
>> should work.
>
> but as someone said, mail (or mailx) would work so much easier...

That was me as well.

Tom
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


f-myth-users at media

Sep 14, 2009, 5:26 PM

Post #15 of 27 (1494 views)
Permalink
Notification of conflicts [In reply to]

> Date: Mon, 14 Sep 2009 13:20:25 -0700
> From: Jim Stichnoth <stichnot [at] gmail>

> If you still have problems finding the perl script or getting it to
> run, you could always try "mythbackend --printsched". Conflicts will
> be indicated by a "C" character in the column labeled "N". Unless the
> formatting of --printsched has changed, this command should work:

> mythbackend --printsched | awk '/^Title - Subtitle/||substr($0,70,1)=="C"{print}'

I do something similar---since I log fairly verbosely from my backend,
I have several different greps all glued to its output with tee, each
of which feeds into various notifiers if they trigger on something.

In other words, I have something like this:

mythbackend [options] | tee >(scanner1) >(scanner2) ... | split [options] logfile

where, for conflicts, one of the scannerN entries is

>(grep --line-buffered -E 'C [0-9]+$' | notice-schedule-conflicts)

and notice-schedule-conflicts is a simple bash script that stores each
hit in a file; if it's already in the file, I've already been notified.
The file gets cleared before mfdb runs. Thus, I only get notified
about any given conflict once a day, instead of every time the
scheduler runs---but since it's monitoring the backend log rather
than doing an explicit printsched every so often, I get notified the
instant the scheduler first creates the conflict. so I find out if it
magically -creates- a conflict right in the middle of primetime when
nothing's been edited and mfdb hasn't run [which it did once] and also
so I know the instant I add a scheduled recording whether it just
bumped something, rather than several hours later. [.It uses the same
cheesy xmessage popup strategy as trac #6899, which is realtime and
good enough for me.]

Note carefully that that grep pattern looks for whitespace and digits
at the end of the line, but does -not- include anything else---in
particular, minus signs. That means it will -not- notify about a
conflict in something with negative priority. That means something
I've explicitly said I don't care is dropped won't also spuriously
notify me, either.

[.Why do I grep in the tee instead of in notice-schedule-conflicts?
Because n-s-s is a simple line-oriented bash script [.it has to be,
so it can immediately add each hit to the don't-tell-me-again file,
unless I'd like to write it in a real language]. Not prefiltering
its input to only give it relevant lines raises its runtime many
thousandfold, to the point where it becomes a noticeable percentage
of the backend.]

Note also the --line-buffered; without it, you might never get the
notification at all, since the grep might not emit anything at all
until it's got a bufferful of output (which could be quite large)
or until its stdin is closed (which is presumably never).
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


bob at oblong

Sep 16, 2009, 12:25 AM

Post #16 of 27 (1400 views)
Permalink
Re: Notification of conflicts [In reply to]

Jim Stichnoth wrote:
[..]

> If you still have problems finding the perl script or getting it to
> run, you could always try "mythbackend --printsched". Conflicts will
> be indicated by a "C" character in the column labeled "N". Unless the
> formatting of --printsched has changed, this command should work:
>
> mythbackend --printsched | awk '/^Title -
> Subtitle/||substr($0,70,1)=="C"{print}'

Neat! But on my system, column "N" (the decoder number to be used?) can
be greater than 10 (as can the "C" column), so the formatting goes bad
and the columns no longer remain fixed width.

So try this (simply grabs the second last field, which is column "N"):
mythbackend --printsched | awk '/^Title - Subtitle/||$(NF-1)=="C"{print}'

--
Bob Long

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Sep 19, 2009, 6:16 AM

Post #17 of 27 (1310 views)
Permalink
Re: Notification of conflicts [In reply to]

On 09/14/2009 08:26 PM, f-myth-users wrote:
> From: Jim Stichnoth
>
> > If you still have problems finding the perl script or getting it to
> > run, you could always try "mythbackend --printsched". Conflicts will
> > be indicated by a "C" character in the column labeled "N". Unless the
> > formatting of --printsched has changed, this command should work:
>
> > mythbackend --printsched | awk '/^Title - Subtitle/||substr($0,70,1)=="C"{print}'
>
> I do something similar---since I log fairly verbosely from my backend,
> I have several different greps all glued to its output with tee, each
> of which feeds into various notifiers if they trigger on something.
>
> In other words, I have something like this:
>
> mythbackend [options] | tee >(scanner1) >(scanner2) ... | split [options] logfile
>
> where, for conflicts, one of the scannerN entries is
>
> >(grep --line-buffered -E 'C [0-9]+$' | notice-schedule-conflicts)
>
> and notice-schedule-conflicts is a simple bash script that stores each
> hit in a file;

http://swatch.sourceforge.net/
http://sourceforge.net/projects/swatch/

http://kodu.neti.ee/~risto/sec/

> if it's already in the file, I've already been notified.
> The file gets cleared before mfdb runs. Thus, I only get notified
> about any given conflict once a day, instead of every time the
> scheduler runs---but since it's monitoring the backend log rather
> than doing an explicit printsched every so often, I get notified the
> instant the scheduler first creates the conflict. so I find out if it
> magically -creates- a conflict right in the middle of primetime when
> nothing's been edited and mfdb hasn't run [which it did once]

There's absolutely no magic in Myth's scheduler and the scheduler does
not create conflicts--people do. Assuming you have no conflicts one
minute, the only way that a conflict could ever be created is if a) your
recording rules change (includes extending an ongoing recording or
saying not to record a show when you're in LiveTV and it asks for the
tuner), b) your listings change, c) some capture cards (i.e. in a remote
backend) drop offline.

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


richard.e.morton at gmail

Sep 19, 2009, 7:30 AM

Post #18 of 27 (1293 views)
Permalink
Re: Notification of conflicts [In reply to]

> There's absolutely no magic in Myth's scheduler and the scheduler does not
> create conflicts--people do.  Assuming you have no conflicts one minute, the
> only way that a conflict could ever be created is if a) your recording rules
> change (includes extending an ongoing recording or saying not to record a
> show when you're in LiveTV and it asks for the tuner), b) your listings
> change, c) some capture cards (i.e. in a remote backend) drop offline.


Hi Mike,

I absolutely agree; but listings do change and people who are not a
competent with Myth do schedule recordings. MythTV also doesnt warn
you when scheduling a new program, or show you any related conflicts.

Combine with that custom recording based on title searches and you can
easily get in a mess.

Recording Schedule conflicts are not static either; when using guide
data which comes in a little bit at a time (a rolling 7, 8 or 28 days)
and non-static programme schedules in most countries (less so in the
US I understand). one week you can have no scheduling conflicts and
another week you can have a couple to deal with.

Problematically a schedule conflict can be auto resolved as following
schedule data is provided by whichever source is used and repeats of
one of the programmes involved in the conflict give myth more
choices... but myth cant resolve all scheduling conflicts this way as
there may not be repeats.

R
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


carlfongheiser at gmail

Sep 19, 2009, 7:48 AM

Post #19 of 27 (1297 views)
Permalink
Re: Notification of conflicts [In reply to]

On Sat, Sep 19, 2009 at 9:30 AM, Richard Morton
<richard.e.morton [at] gmail> wrote:
> I absolutely agree; but listings do change and people who are not a
> competent with Myth do schedule recordings. MythTV also doesnt warn
> you when scheduling a new program, or show you any related conflicts.

There are two ways to do that, actually. In mythfrontend, you can use
the "Preview Schedule Changes" option on the schedule recording screen
to see what the impact will be. The mythweb schedule page shows you
potentially conflicting shows right there on the page.

Carl Fongheiser
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


richard.e.morton at gmail

Sep 19, 2009, 7:52 AM

Post #20 of 27 (1296 views)
Permalink
Re: Notification of conflicts [In reply to]

> There are two ways to do that, actually.  In mythfrontend, you can use
> the "Preview Schedule Changes" option on the schedule recording screen
> to see what the impact will be.  The mythweb schedule page shows you
> potentially conflicting shows right there on the page.
>

Carl, thanks. I am aware of these. The subject is "notification" not
"review" but this requires you to do that. an email or other
notification is event driven and much more user friendly as it prompts
you to do review them...

sorry to be blunt.

R
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Sep 19, 2009, 8:12 AM

Post #21 of 27 (1285 views)
Permalink
Re: Notification of conflicts [In reply to]

On 09/19/2009 10:30 AM, Richard Morton wrote:
>> There's absolutely no magic in Myth's scheduler and the scheduler does not
>> create conflicts--people do. Assuming you have no conflicts one minute, the
>> only way that a conflict could ever be created is if a) your recording rules
>> change (includes extending an ongoing recording or saying not to record a
>> show when you're in LiveTV and it asks for the tuner), b) your listings
>> change, c) some capture cards (i.e. in a remote backend) drop offline.
> I absolutely agree; but listings do change and people who are not a
> competent with Myth do schedule recordings. MythTV also doesnt warn
> you when scheduling a new program, or show you any related conflicts.
>
> Combine with that custom recording based on title searches and you can
> easily get in a mess.
>
> Recording Schedule conflicts are not static either; when using guide
> data which comes in a little bit at a time (a rolling 7, 8 or 28 days)
> and non-static programme schedules in most countries (less so in the
> US I understand). one week you can have no scheduling conflicts and
> another week you can have a couple to deal with.
>
> Problematically a schedule conflict can be auto resolved as following
> schedule data is provided by whichever source is used and repeats of
> one of the programmes involved in the conflict give myth more
> choices... but myth cant resolve all scheduling conflicts this way as
> there may not be repeats.

I wasn't disagreeing with the need/desire for notifications. I was
simply disagreeing with f-myth-user's saying:

>>> so I find out if it
>>> magically -creates- a conflict right in the middle of primetime when
>>> nothing's been edited and mfdb hasn't run [which it did once]

which you completely cut out of my reply.

I even gave links to "real" programs that monitor logs--allowing you to
get notifications real time--so he wouldn't have to use hacked-together
bash scripts with 10's of instances of tee and grep and ...

http://swatch.sourceforge.net/
http://sourceforge.net/projects/swatch/

http://kodu.neti.ee/~risto/sec/

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


richard.e.morton at gmail

Sep 19, 2009, 8:15 AM

Post #22 of 27 (1300 views)
Permalink
Re: Notification of conflicts [In reply to]

apologies, I should have read more carefully.

Which log files shoudl these apps be parsing to get the info required
and generate the notification?

R
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Sep 19, 2009, 8:33 AM

Post #23 of 27 (1287 views)
Permalink
Re: Notification of conflicts [In reply to]

On 09/19/2009 11:15 AM, Richard Morton wrote:
> apologies, I should have read more carefully.
>
> Which log files shoudl these apps be parsing to get the info required
> and generate the notification?

Well, he's parsing the (master) mythbackend log file. I don't know what
verbose arguments he's using, but you'd likely need to add some to the
default of -v important,general to actually get info on conflicts.

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


f-myth-users at media

Sep 19, 2009, 2:20 PM

Post #24 of 27 (1269 views)
Permalink
Notification of conflicts [In reply to]

> Date: Sat, 19 Sep 2009 11:33:39 -0400
> From: "Michael T. Dean" <mtdean [at] thirdcontact>

> On 09/19/2009 11:15 AM, Richard Morton wrote:
> > apologies, I should have read more carefully.
> >
> > Which log files shoudl these apps be parsing to get the info required
> > and generate the notification?

> Well, he's parsing the (master) mythbackend log file. I don't know what
> verbose arguments he's using, but you'd likely need to add some to the
> default of -v important,general to actually get info on conflicts.

In particular, you probably want "schedule".

(You could also try "all", but that will likely drown you in output.
jobqueue in particular was incredibly verbose the one time I tried
it.)

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


f-myth-users at media

Sep 19, 2009, 8:32 PM

Post #25 of 27 (1229 views)
Permalink
Notification of conflicts [In reply to]

> Date: Sat, 19 Sep 2009 09:16:40 -0400
> From: "Michael T. Dean" <mtdean [at] thirdcontact>

> http://swatch.sourceforge.net/
> http://sourceforge.net/projects/swatch/

> http://kodu.neti.ee/~risto/sec/

Useful in general, but they and things like that were too much for
what I was trying to do. Just reading their documentation carefully
is a more involved endeavor than the writing the script; the hardest
part of the script was making sure I knew exactly what log line I
wanted to notice in the backend logs (something that use of any
logging tool would require anyway), and that wasn't too hard...

> > if it's already in the file, I've already been notified.
> > The file gets cleared before mfdb runs. Thus, I only get notified
> > about any given conflict once a day, instead of every time the
> > scheduler runs---but since it's monitoring the backend log rather
> > than doing an explicit printsched every so often, I get notified the
> > instant the scheduler first creates the conflict. so I find out if it
> > magically -creates- a conflict right in the middle of primetime when
> > nothing's been edited and mfdb hasn't run [which it did once]

> There's absolutely no magic in Myth's scheduler and the scheduler does
> not create conflicts--people do. Assuming you have no conflicts one
> minute, the only way that a conflict could ever be created is if a) your
> recording rules change (includes extending an ongoing recording or
> saying not to record a show when you're in LiveTV and it asks for the
> tuner), b) your listings change, c) some capture cards (i.e. in a remote
> backend) drop offline.

*sigh*

Okay, look. I didn't want to have to write yet another thousand-word
message to keep the nitpickers at bay, so I said "magically" instead
of going through all the rigor.

But since you apparently won't rest without it, here's the issue:

People have occasionally complained that Myth might sometimes be
suboptimal in how it allocates tuners, sometimes saying, "But why
doesn't the scheduler -know- that it can use this tuner over here
while it's using that tuner over there, instead of going for the
repeat later?" The response has always been, of course, that Myth's
scheduler is not a TMS, nor does it employ arbitrary numbers of
passes to guarantee optimality, and that the current behavior is
instead a good heuristic that works most of the time but is not
guaranteed to be optimal at all times. This means that every time
the scheduler actually reschedules after the situation changes (e.g.,
after a recording has finished, thus changing the exact situation),
it may pick a slightly different solution, and that solution may be
suboptimal.

You know this.

Therefore, what makes you think that scheduler -cannot- trip over its
own feet and -instigate- a conflict on its very own when it's running
after a showing ends?

In my particular case:
(a) I don't use EIT.
(b) I run mfdb from a cronjob, so I know -absolutely- when it runs.
(c) I run mfdb in the morning.
(d) The failure happened during primetime, 12 hours after the mfdb run
and maybe 5-10 scheduler runs after the last mfdb.
(e) I am the only person with access to any frontend or Mythweb or the
backend, e.g., the only person who could -possibly- make any
changes was me.
(f) I made no changes.
(g) I -checked- that I made no changes, by reviewing my logs.
I didn't touch the box for many hours before the mishap.
I log everything but jobqueue from the backend, and I log
all http interactions from Mythweb.
(h) I still had up the Scheduled Recordings page in my browser from
the afternoon sometime (when no recordings were going on) that
showed the correct behavior. That page was computed quite a while
-after- any possible scheduling change I'd made, e.g., I wasn't
looking at old data while the scheduler was busy churning away on
a change. [.In fact, while I don't remember right now, I suspect I
hadn't made any changes since the previous day, if that.]
(i) I didn't make any scheduling changes after I'd gotten that SR
page. The logs were conclusive.
(j) LiveTV was not in use. (It's never in use, unless I'm debugging a
tuner or something.) In fact, the frontend had not been in use
at all that evening.
(k) When I noticed that Myth had failed to record one of the primetime
shows, I clicked on that entry in Scheduled Recordings, putting it
in a new window so I wouldn't lose the existing SR, and the
program details said that the showing was not recorded due to a
conflict---a conflict which was NOT called out in the SR page
sitting in my browser from the afternoon.
(l) Which tuners were in use for other recordings was shuffled
somewhat from the SR page, which was not surprising, since the
scheduler had obviously changed its mind at some point.
(m) I reviewed my backend logs, which include "schedule". I nailed
exactly which scheduler run changed the intended recording from
being on a tuner to "C". Essentially, a scheduler run around 8pm
at the end of one showing of something caused the 10pm showing of
something else to suddenly be conflicting, and so when 10pm rolled
around, the 10pm show was not recorded. (There were several other
recordings ongoing from maybe 7pm until probably past midnight
that night; that was the only one that conflicted.)
(n) The backend was not rebooted that day, not did mythbackend restart
itself. (Of course, by your logic, doing so could never affect a
conflict anyway and is hence irrelevant, but I figured I'd mention
it anyway.)
(o) No tuners went offline or otherwise logged errors. I don't
remember at this late date (months later) whether there was
actually a -free- tuner during the "conflicted" time, or whether
Myth shuffled things around to use all tuners but continued to
think it couldn't record the conflicted show, but it doesn't
matter---a recording which had shown up as nonconflicting in SR
hours earlier had, with zero user input nor changes to the
listings, become conflicting.
(p) The configuration at that time was (and still is) a single MBE
with no slaves. Therefore, I did not suddenly lose and then
reacquire a tuner due to a network glitch or something like that.
(q) I have never, in the entire history of my use of Myth, had a tuner
drop out in a way that caused Myth to assume it couldn't be used.
I've had tuners produce zero-length files (long ago, and rarely),
and I've had all kinds of misbehavior about the signal that was
actually -getting- to the tuner, but I've never seen Myth just
spontaneously decide a tuner wasn't there---much less add it right
back for the next show.
(r) I record in only SD, from PVR-250's. Therefore, there is no funny
business going on with Firewire, ATSC, or any of the other zillion
ways in which a signal source can become invalid in a way that
causes Myth to think it's not there.
(s) This was not even in the same month as a daylight-savings
transition. (That's a separate sore spot between me and Myth.)

Since I'm sure you will no doubt find some excuse for why this was
somehow user error and not the scheduler's fault, in what way is the
list above not exhaustive? I will happily address it if you think
it matters.

I keep all my logs forever. (Why? In part because of the whole "Myth
doesn't deign to keep--in the database---information about which tuner
recorded something" issue that somebody brought up [again] a few weeks
ago, and in part because I want to be able to precisely characterize
problems even if they take weeks to become apparent.) That means I
-could-, theoretically, go back and find the exact log that showed the
failure. But that would require me to spend the time to figure out
exactly when it happened, which might take me some time, and the only
purpose would be to play the sorts of one-upmanship games which you
seem to enjoy but which I find incredibly distasteful.

So I'll just leave it at that. Either you believe me or not. You
know that the scheduler is not guaranteed to be perfect. In several
years and many thousands of recordings, this is the only case in which
I can -prove- that it was this heuristic behavior that screwed me and
not some issue with me or with the listings. But the probability is
-not- zero. It may be low, but it's -not- zero.

And that's why I wrote the conflict notifier. I was sufficiently
pissed off by the behavior that I wanted to ensure that if it ever
happened again, I'd have a chance of dealing with it. Since I wrote
it, it's come in handy in saving me from having to manually check for
conflicts, which is a nice bonus and makes the (relatively small)
amount of work required to write it even more worthwhile.

And that's all. Since other people were discussing the issue, it
occurred to me that I might chime in and offer to help save people
from a range of similar issues, if they wanted the code.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

First page Previous page 1 2 Next page Last page  View All MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.