Charmed Quark Systems, Ltd. - Support Forums and Community

Full Version: how to monitor tcp port or ping with CQC?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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?
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.
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
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...
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 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.
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...
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.
And i'll try and get it added to the Network Monitor driver...
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;
Pages: 1 2