Ad Widget

Collapse

proc.num, net.tcp.service questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mactfines
    Junior Member
    • Nov 2007
    • 5

    #1

    proc.num, net.tcp.service questions

    Hi,

    First, a compliment. Thank you for all of your work on Zabbix. The more I use it, the more I like it!

    proc.num question (feature request?)
    We use Novell Identity Manager. One of our Linux Systems, runs a daemon called usdrv. If you do "ps -ef | grep usdrv", one process should be displayed.

    But when I would query the number of usdrv procs with Zabbix, using "zabbix_get -slocalhost -kproc.num[usdrv]" it would always return 7.

    I then found that if I added the "-m" switch to my ps command, which means "show all threads" to ps, it would show 7 usdrv procs. OK, now I understood where Zabbix was getting 7.

    It would be nice to be able to control how Zabbix counts processes with "proc.num" in the same way one can with the ps command. If this is already possible and I just missed it, please let me know.

    I bring this up because if we have a problem with one of the usdrv scripts, "ps -ef | grep usdrv" will show more than 1 proc, while when it is correctly running, it will only show one. To be able to trigger for "not 1" would be nice.

    net.tcp.service
    How do I get a service recognized by zabbix? Here's what I'm having trouble with. Our IDM system, as mentioned above, listens on port 8090. I tried querying it with "zabbix_get -slocalhost -knet.tcp.service[idm,127.0.0.1,8090]", after making sure the service was up and listening on that port/IP. I'd get back "ZBX_NOTSUPPORTED."

    I assumed this meant Zabbix didn't know what the "idm" service was. So I edited /etc/services and added a line for it and restarted the server. zabbix_get still wouldn't work.

    As a guess, I then did "zabbix_get -slocalhost -knet.tcp.service[ftp,127.0.0.1,8090]", which worked. The service listening on port 8090 is not FTP, but by calling it ftp instead of an unrecognized name, zabbix was able to query it.

    So, how do I add service names to zabbix? It seems to me it should just use ones from /etc/services. Also, it doesn't make sense to me that zabbix would fail using 'idm' but work with 'ftp' when the service is not an ftp service. It mustn't be doing a protocol check or it would fail when I used 'ftp', so why should it care what name I use anyway?

    In the meantime, I am just using net.tcp.port[localhost,8090], which works fine.

    Thanks,
    Ted
  • jsabater
    Junior Member
    • Aug 2008
    • 5

    #2
    Originally posted by mactfines
    So, how do I add service names to zabbix? It seems to me it should just use ones from /etc/services. Also, it doesn't make sense to me that zabbix would fail using 'idm' but work with 'ftp' when the service is not an ftp service. It mustn't be doing a protocol check or it would fail when I used 'ftp', so why should it care what name I use anyway?
    Same problem here. Zabbix does not seem to recognise the entries in /etc/services, even if they are both in the machine running the agent and in the machine running the server.

    What I did was use net.tcp.service[tcp,localhost,3310]. I have not found any way to add new services to Zabbix, not in the forums, in the wiki, in the documentation, in the manual or in the frontend.

    Comment

    • exkg
      Senior Member
      Zabbix Certified Trainer
      Zabbix Certified Specialist
      • Mar 2007
      • 718

      #3
      Hi,


      Is necessary put your services in 'src/libs/zbxsysinfo/simple/simple.c'.
      Today the services avaliable are:

      ===
      # grep "else if(strcmp(service" libs/zbxsysinfo/simple/simple.c
      else if(strcmp(service,"ldap") == 0)
      else if(strcmp(service,"smtp") == 0)
      else if(strcmp(service,"ftp") == 0)
      else if(strcmp(service,"http") == 0)
      else if(strcmp(service,"pop") == 0)
      else if(strcmp(service,"nntp") == 0)
      else if(strcmp(service,"imap") == 0)
      else if(strcmp(service,"tcp") == 0)
      else if(strcmp(service,"service.ntp") == 0)
      else if(strcmp(service,"ldap") == 0)
      else if(strcmp(service,"smtp") == 0)
      else if(strcmp(service,"ftp") == 0)
      else if(strcmp(service,"http") == 0)
      else if(strcmp(service,"pop") == 0)
      else if(strcmp(service,"nntp") == 0)
      else if(strcmp(service,"imap") == 0)
      else if(strcmp(service,"tcp") == 0)
      ===


      []s,
      Luciano
      --
      Luciano Alves
      www.zabbix.com
      Brazil | México | Argentina | Colômbia | Chile
      Zabbix Performance Tuning

      Comment

      • jsabater
        Junior Member
        • Aug 2008
        • 5

        #4
        Ah, I see. Thanks for the information. I guess it must be due to /etc/services not being present in all platforms, isn't it?

        Just incidentally, any plans to ship a IANA services with Zabbix and make use of it?

        Comment

        • noxis
          Senior Member
          • Aug 2007
          • 145

          #5
          So what you saying is that it is utterly pointless specifying a service name as it is meaningless? It doesnt check that "ftp is talking ftp" or "http is talking http"?

          Does it work when the daemon has just hung? The port is still open but nothing is responding?

          Comment

          • jsabater
            Junior Member
            • Aug 2008
            • 5

            #6
            Originally posted by noxis
            So what you saying is that it is utterly pointless specifying a service name as it is meaningless? It doesnt check that "ftp is talking ftp" or "http is talking http"?
            AFAIK, no, it does not check that FTP is talking FTP, just that the connection can be stablished.

            Does it work when the daemon has just hung? The port is still open but nothing is responding?
            This is something that I am checking myself, too. AFAIK, the kernel will stablish the connection, not the actual service. I mean before it's some protocol we are talking about. But it's the kernel that establishes the initial connection. Therefore if the daemon is hang up, the kernel would still answer.

            On the other hand, checking that a count of processes by the name "Name" is not less than 1 won't serve in this case, as the daemon is there, but frozen.

            As I said, I am still investigating this, therefore I may be mistaken. Any feedback on this would be greatly appreciated.

            Comment

            • noxis
              Senior Member
              • Aug 2007
              • 145

              #7
              Originally posted by jsabater
              AFAIK, no, it does not check that FTP is talking FTP, just that the connection can be stablished.



              This is something that I am checking myself, too. AFAIK, the kernel will stablish the connection, not the actual service. I mean before it's some protocol we are talking about. But it's the kernel that establishes the initial connection. Therefore if the daemon is hang up, the kernel would still answer.

              On the other hand, checking that a count of processes by the name "Name" is not less than 1 won't serve in this case, as the daemon is there, but frozen.

              As I said, I am still investigating this, therefore I may be mistaken. Any feedback on this would be greatly appreciated.
              Ok just checked the source and I must eat my words:

              Code:
              else if(strcmp(service,"imap") == 0)
                      {
                              if(port == 0)   port=143;
                              ret=tcp_expect(ip,port,NULL,"* OK","a1 LOGOUT\n",&value_int);
                      }
              It does other sensible things for other services.

              Comment

              • noxis
                Senior Member
                • Aug 2007
                • 145

                #8
                Originally posted by noxis
                Ok just checked the source and I must eat my words:

                Code:
                else if(strcmp(service,"imap") == 0)
                        {
                                if(port == 0)   port=143;
                                ret=tcp_expect(ip,port,NULL,"* OK","a1 LOGOUT\n",&value_int);
                        }
                It does other sensible things for other services.
                Hmm reconsidering it is actually working now. If I connect to a POP server but specify FTP it still thinks everything is "1 - service is running". Same for the opposite, if I connect to a FTP server and specify POP then it still thinks everything is fine.

                This kinda makes it a useless check imo...
                Last edited by noxis; 17-09-2008, 17:31.

                Comment

                • jsabater
                  Junior Member
                  • Aug 2008
                  • 5

                  #9
                  Originally posted by noxis
                  Hmm reconsidering it is actually working now. If I connect to a POP server but specify FTP it still thinks everything is "1 - service is running".
                  Yep, that is the point in which I am now. Always seems to work, so I've ended up using always "tcp".

                  Comment

                  • noxis
                    Senior Member
                    • Aug 2007
                    • 145

                    #10
                    Originally posted by jsabater
                    Yep, that is the point in which I am now. Always seems to work, so I've ended up using always "tcp".
                    Well it took approx 15 - 20min to write a perl script that connects to any given port and you pass an argument at command line with what it should expect the banner response to be. For example POP would be "+OK".

                    Comment

                    Working...