PDA

View Full Version : Plugin Request: Run external command on error


tedson
06-13-2010, 08:13 AM
Could one of the master plug-in builders, build a plug-in that would run a command line application when there is a sage error message (or if there is a plug-in that does this already could you point me at it.) It would need to pass in the message and if possible the error level. If someone will write that I could build an app that will go out and reboot an HDPVR when it fails (assuming you have one of these http://www.digital-loggers.com/lpc.html.)

Invent
06-13-2010, 08:30 AM
I could also use this, and for the EXACT same reason.

I have wondered if the SageAlert plugin could be used to do this, or be modified to do it.

I use Girder in my PC, so once some trigger exists that I can interpret as "time to power cycle the HD-PVR" - I can do that, log it, note what show was recording or that it was coincident with a channel change, email myself, etc....

Running an external program is a great way to get that trigger easily.

Hence massively increasing WAF. HD-PVR is annoying. :mad:

toricred
06-13-2010, 08:58 AM
Sage Job Queue (SJQ) can do this. I'm doing exactly this with it.

tedson
06-13-2010, 10:52 AM
toricred could you post your rule for SJQ so I could take a look at how your doing it.

toricred
06-13-2010, 02:08 PM
Here's my client ruleset:


REBOOTHDPVR4 {

"C:/Reboot/HDPVRCycle4.bat"
}

REBOOTHDPVR3 {

"C:/Reboot/HDPVRCycle3.bat"
}

REBOOTHDPVR2 {

"C:/Reboot/HDPVRCycle2.bat"
}

REBOOTHDPVR1 {

"C:/Reboot/HDPVRCycle1.bat"
}

And my SJQ ruleset:

if [IsObjSysMsg == true && $.GetSystemMessageString{} =* "Hauppauge HD PVR Capture Device #4"] {
REBOOTHDPVR4
}

if [IsObjSysMsg == true && $.GetSystemMessageString{} =* "Hauppauge HD PVR Capture Device #3"] {
REBOOTHDPVR3
}

if [IsObjSysMsg == true && $.GetSystemMessageString{} =* "Hauppauge HD PVR Capture Device #2"] {
REBOOTHDPVR2
}

if [IsObjSysMsg == true && $.GetSystemMessageString{} =* "Hauppauge HD PVR Capture Device Component"] {
REBOOTHDPVR1
}

Invent
06-13-2010, 04:43 PM
Hi toricred,

Very helpful and appreciated posting! :goodjob: I'm running SJQ already for comskip so this should be a perfect solution.

How did you determine the system message strings such as

"Hauppauge HD PVR Capture Device #2"

and

"Hauppauge HD PVR Capture Device Component"

?? I'd like to know how to do that / check it is correct on my system / respond to other events etc.

Thanks in advance...!

bikesquid
06-13-2010, 07:03 PM
Here's my client ruleset:


REBOOTHDPVR4 {

"C:/Reboot/HDPVRCycle4.bat"
}


}


This is great, helpful stuff, but I wonder what the contents of the referenced batch file is... am I missing something?:confused:

toricred
06-13-2010, 08:10 PM
The contents of the batch file depend on what command is used to cycle the power on your power strip. You need an IP controlled power strip for this to work. In my case it is:

"C:\Program Files\Growl for Windows\Displays\Scripty\UU.W32.exe" 192.168.1.3:80 user:password 4pulse

I got the text by setting up Sage Alert (I had been using it before) and looking at the text in the e-mail I receive. You could also just look at the text in the system message area.

bikesquid
06-14-2010, 01:40 PM
Got it, makes sense except I usually have to restart sage and the sage service to get the %$#* HDPVR to be working w/sage again. Are you just power cycling the hdpvr and letting sage reconnect on it's own?

toricred
06-14-2010, 07:09 PM
All I'm doing is cycling the power on the hdpvr. It clears the problem over 99.99% of the time. I've also had no lockups at all since installing the 1.5.6.2 drivers, but that's only been a couple of days.

bikesquid
06-14-2010, 07:32 PM
Where'd you get the 1.5.6.2 driver... and more importantly (to me) how can I get it?
I'm still seeing 1.5.6.1 on the hdpvr support page....

EDIT: nevermind, found this thread http://forums.sagetv.com/forums/showthread.php?t=49103