Hi,
Below is a solution rather than a question. Just thought I share it with the rest of the PRTG world.
Our challenge:
Projectors are having issues "out of now where" and of course always urgent - IT department didn't have monitoring on it. Of course, normally you already have a conference going on or it is urgent and the projector might be really down already - most likely due to an end of life light bulb.
What we have:
NEC and Optima projectors - with Ethernet interfaces
Research and work:
We found out that there is a PJLink protocol (http://pjlink.jbmia.or.jp/english/index.html) that is supported by those devices. A little more research and we found a library on GitHub for Visual Studio (C#) (https://github.com/uow-dmurrell/ProjectorControl). We took it, modified the LAMPHOURS so we could get it public (only one lamp for now - but we only have projectors with one lamp). Modified the TEST-Project that comes with it to accept IP addresses as parameter and modified the output in to a PRTG XML format. Further modified the output so it is numeric. (We are not aware that any of that stuff is copyright protected, if so - we apologize and will stop using those components)
Result:
We added a PRTG sensor based on XML data that monitors (advanced EXE/XML) with the IP of the device as parameter and get the following information:
- LampHours - we set ours to max. 4000 as error level
- CoverStatus (0 OK / 1 ERROR)
- FanStatus (0 OK / 1 ERROR)
- FilterStatus (0 OK / 1 ERROR)
- LampStatus (0 OK / 1 ERROR)
- PowerStatus (0 off / 1 on = OK 2 cool down / 3 warm up = WARNING (we don't get alerts there) 4 unknown = ERROR)
This actually helps us to keep an as close as possible eye on the projectors and being proactive if something is already reported as defect and the LampHours (adjustable, depending on manufacturer/model) are coming close to an issue, so we are ready for it.
Code changes:
ProjectorInfo.cs - added this:
public int LampHours { get { return _multiLampHours[0]; } set { } }
Program.cs (or create your own project)
using System; using rv; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { PJLinkConnection c = new PJLinkConnection(args[0], "rv"); if (args.Length != 1) { Console.WriteLine("Wrong arguments detected:"); foreach(string arg in args) { Console.WriteLine(arg); } } ProjectorInfo pi = ProjectorInfo.create(c); string powerstatus = "0"; string fanstatus = "0"; string lampstatus = "0"; string coverstatus = "0"; string filterstatus = "0"; //PowerStatus: //OFF 0 //ON 1 //COOLING 2 //WARMUP 3 //UNKNOWN 4 if (pi.PowerStatus.ToString() == "OFF") { powerstatus = "0"; }; if (pi.PowerStatus.ToString() == "ON") { powerstatus = "1"; }; if (pi.PowerStatus.ToString() == "COOLING") { powerstatus = "2"; }; if (pi.PowerStatus.ToString() == "WARMUP") { powerstatus = "3"; }; if (pi.PowerStatus.ToString() == "UNKNOWN") { powerstatus = "4"; }; if (pi.FanStatus.ToString() != "OK") { fanstatus = "1"; }; if (pi.LampStatus.ToString() != "OK") { lampstatus = "1"; }; if (pi.CoverStatus.ToString() != "OK") { coverstatus = "1"; }; if (pi.FilterStatus.ToString() != "OK") { filterstatus = "1"; }; string prtg = "<prtg>\n" + "<result><channel>PowerStatus</channel><value>" + powerstatus.ToString() + "</value></result>\n" + "<result><channel>LampHours</channel><value>" + pi.LampHours.ToString() + "</value></result>\n" + "<result><channel>FanStatus</channel><value>" + fanstatus.ToString() + "</value></result>\n" + "<result><channel>LampStatus</channel><value>" + lampstatus.ToString() + "</value></result>\n" + "<result><channel>CoverStatus</channel><value>" + coverstatus.ToString() + "</value></result>\n" + "<result><channel>FilterStatus</channel><value>" + filterstatus.ToString() + "</value></result>\n" + "</prtg>"; Console.WriteLine(prtg); //Console.ReadKey(); // this is only for debug to pause the output window / stop closing it } } }
Add comment