Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to monitor tcp port or ping with CQC?
#1
I have few servers at home:
lime storage
sagetv
asterisk (askozia voip)
linux server based HP T5720

how i can monitor that ports possible to connect or http request with CQC?
Reply
#2
You would need to write a driver that attempts to open up selected ports on those machines periodically and sets a field to whether it worked or not.
Dean Roddey
Explorans limites defectum
Reply
#3
The asterisk server possibly has SNMP
Windows has a snmp service that you could use as well.
I dont know about the other two, but snmp would be a good place to start. You may not get the status of the port, but you may get something that can imply that the port is open (or are you trying to imply something from the fact that the port is open).

Mick
Reply
#4
Dean, for checking that your internet is working, you'd have to ping some outside website occassionally. Are there internet "good conduct" specs for how often and how you'd do that? And along those lines....what about pinging some part of charmedquark.com??

I wouldn't mind some kind of means to determine if my internet is down, because 90% of the time it is, I just go reboot my DSL modem and it's back up. It'd be kind of nice to do that automatically...
Reply
#5
I definitely wouldn't want everyone pinging our server. There are plenty of far higher capacity servers out there to ping, like google or microsoft.
Dean Roddey
Explorans limites defectum
Reply
#6
Dean Roddey Wrote:I definitely wouldn't want everyone pinging our server. There are plenty of far higher capacity servers out there to ping, like google or microsoft.
xaxaxa!!!

my asterisk has no snmp protocol...
looks like i need to install nagius on some linux host.
Reply
#7
In places where multiple locations can be tested, I tend to use the DNS servers upstream from me. The problem with using a single ip would be when one is offline. That doesn't mean the link is down, just that one box. You might also consider getting an ntp driver to a decent sized server (I like the Naval Observatory servers) or a driver to any other small footprint protocol that checks status (pop3/imap logins to a google server) would be just as good.

Russ...
Reply
#8
This is a kind of old thread, and I know others have mentioned this more recently, but I found this one... Just FYI, I just added the code to support doing pings to the latest .905 beta, so that will be there in the next drop. See the beta discussion thread for some info. I'll document the CML wrapper class tomorrow when I get it done.
Dean Roddey
Explorans limites defectum
Reply
#9
And i'll try and get it added to the Network Monitor driver...
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#10
Here is a simple example pinger in CML. It's quite simple to use. You wouldn't do it exactly this way in a driver. I'm just doing it like a standard command line pinger would do, with the send of the request and a single 10 second wait all together. Whereas a driver would start the request, and come back later to do a quick test of whether the response is available.

Also the response time being returned in my case is accurate. In a driver scenario it wouldn't really be since it would include the time until you got back to look for it having come in.

Code:
Class=[NonFinal]
    ClassPath MEng.TestPing;
    ParentClass MEng.Object;
EndClass;

Imports=
    MEng.System.Runtime.ConsoleOutStream;
    MEng.System.Runtime.SockPinger;
    MEng.System.Runtime.IPEndPoint;
EndImports;

Members=
    SockPinger          m_Pinger;
    ConsoleOutStream    m_OutCon;
    Time                m_Time;
EndMembers;

Methods=[Public,Final]

    Constructor()
    Begin
    EndConstructor;

    Method Start([In] String TarAddr) Returns Int4
    Begin
        Locals=
            IPEndPoint  TarEP;
            Card4       LoopIndex(0);
            Card4       RepMSs;
        EndLocals;

        Try
            m_Pinger.StartPing(TarAddr, IPAddrTypes.Unspec, TarEP);
            m_OutCon.FmtStr("Pinging address ");
            m_OutCon.Format(TarEP);
            m_OutCon.DNewLn();
            m_OutCon.Flush();

            While(LoopIndex < 3)
                m_Pinger.SendRequest();

                If (m_Pinger.WaitReply(10000, RepMSs))
                    m_OutCon.FmtStr("   Got a reply. Millis=");
                    m_OutCon.FmtCard4(RepMSs);
                Else
                    m_OutCon.FmtStr("   Did not get a reply");
                EndIf;
                m_OutCon.NewLn();
                m_OutCon.Flush();

                LoopIndex++;
                m_Time.Sleep(1000);
            EndWhile;

        EndTry;

        Catch
            m_OutCon.FmtStr("\nEXCEPTION: ");
            m_OutCon.FmtStr($Exception.GetErrorText());
            m_OutCon.NewLn();
        EndCatch;

        m_OutCon.Flush();

        Return 0;
    EndMethod;
EndMethods;
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Question on CQC / WSE 2016 / Port 443 kblagron 3 5,508 11-15-2017, 09:06 PM
Last Post: Dean Roddey
  Serial Port Demons batwater 13 11,394 03-06-2017, 02:30 PM
Last Post: batwater
  cheap single port TCP/Serial? SomeWhatLost 15 7,992 08-22-2016, 08:12 PM
Last Post: Dean Roddey
  Baby Monitor? Sendero 5 2,718 02-15-2016, 05:49 PM
Last Post: jkmonroe
  8 port relay board with RS232 or Ethernet - Cheap znelbok 2 3,176 02-03-2015, 11:33 AM
Last Post: znelbok
  Energy Monitor by Outlet/Plug? jkmonroe 13 4,369 01-16-2014, 03:44 PM
Last Post: jkmonroe
  HP L2105tm Optical Touch Monitor LesAuber 0 1,361 04-15-2013, 11:13 AM
Last Post: LesAuber
  Com port redirecter help SomeWhatLost 5 2,787 02-03-2011, 03:00 PM
Last Post: Dean Roddey
  Lantronix serial port thingy reliability SomeWhatLost 15 5,965 04-08-2010, 12:28 PM
Last Post: SomeWhatLost
  Any easy way to Ping? anogee 4 2,678 07-21-2009, 05:07 PM
Last Post: broconne

Forum Jump:


Users browsing this thread: 1 Guest(s)