Facility Control

 View Only
  • 1.  custom panel network status

    Posted 28 days ago

    hi,

    Is there a way to get a warning when the network disconnects on the custom panel? Like a ping?

    thanks.



    ------------------------------
    ferhat ozgun
    ------------------------------


  • 2.  RE: custom panel network status

    Posted 16 days ago

    Hi Ferhat,

    Can you clarify what you mean by network disconnects? Do you mean a device used in a custom panel loses its connection, or you lose your internet connection?



    ------------------------------
    Cheers,

    Aury Rukazana
    Senior Software Developer
    Ross Video
    ------------------------------



  • 3.  RE: custom panel network status

    Posted 16 days ago

    Hi Aury,

    I want to check the connection health of special devices using the Ultrix Matrix. It should alert me when the connection is lost.

    I'm using a script like this, but it seems to be causing excessive traffic on the ultrix port.

    <meta>
    <api>var checkCount = 0;
    var lastStatus = "UNKNOWN";

    function checkNetwork() {
    checkCount++;
    var host = "10.90.8.11";
    var port = 80;

    ogscript.debug("Manual Check #" + checkCount);

    try {
    var startTime = new Date().getTime();
    var socket = new java.net.Socket();
    socket.connect(new java.net.InetSocketAddress(host, port), 3000);
    var endTime = new Date().getTime();
    socket.close();

    var ping = endTime - startTime;
    lastStatus = "ONLINE - " + ping + "ms";

    // ONLINE - Yeşil tema
    ogscript.setStyle("_top", "bdr:thick;bdr#00FF00;bg#003300;");
    updateButtonStyle("bg#00FF00;fg#003300;bdr:thick;bdr#00FF00;", "✅ ONLINE");
    ogscript.debug("ONLINE - Ping: " + ping + "ms");

    } catch (e) {
    lastStatus = "OFFLINE";

    // OFFLINE - Kırmızı tema
    ogscript.setStyle("_top", "bdr:thick;bdr#FF0000;bg#330000;");
    updateButtonStyle("bg#FF0000;fg#330000;bdr:thick;bdr#FF0000;", "test");
    ogscript.debug("OFFLINE");
    }

    // Status label'ını güncelle
    //updateStatusLabel();
    }

    function updateButtonStyle(buttonStyle, buttonText) {
    ogscript.setXML("mainButton", "");
    var newXML = '&lt;table id="mainButton" height="50" left="189" right="181" name="' + buttonText + '" style="size:20;font:bold;' + buttonStyle + '" top="10" &gt;&lt;tr&gt;&lt;param anchor="center" colspan="1" contextid="Ultrix.1" expand="true" fill="both" header="true" height="50" oid="params.frame.time" style="bg#modaloverlay;bdr:shadow;font:bold;size:Bigger;txt-align:center;fg#0CF227;" weightx="1.0" weighty="1.0"&gt;&lt;task tasktype="ogscript"&gt;&lt;![CDATA[// Clock]]&gt;&lt;/task&gt;&lt;/param&gt;&lt;/tr&gt;&lt;/table&gt;';
    ogscript.appendXML("_top", newXML);
    }

    //function updateStatusLabel() {
    // var statusText = "Last Check: " + lastStatus + "\\nTotal Checks: " + checkCount;
    // ogscript.setXML("statusLabel", "");
    // var newXML = '&lt;label id="statusLabel" height="60" left="50" name="' + statusText + '" style="txt-align:center;bdr:none;bg#000000;fg#FFFFFF;size:12;" top="300" width="300"/&gt;';
    // ogscript.appendXML("_top", newXML);

    //}</api>
    <ogscript handles="onload">ogscript.debug("COLOR CHANGING BUTTON MONITOR STARTED");
    checkNetwork();</ogscript>
    </meta>



    ------------------------------
    ferhat ozgun
    ------------------------------