Ad Widget

Collapse

more proc.num

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • denso
    Member
    • Sep 2005
    • 32

    #1

    more proc.num

    does the proc.num parm support spaces or chatacters like alik a single dot or a colon ?
    I am trying to monitor how many processes are launching from apache with different configs as the difference in the command line, same user, but the command line is different as httpd.conf or httpd_pls.conf

    any ideas how to monitor these seprate values ?
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    See http://www.zabbix.com/forum/showthread.php?t=3493
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • denso
      Member
      • Sep 2005
      • 32

      #3
      Something odd

      I know about the cmdline parm and am currently using it but this is what is odd

      zabbix get returns 29 when queried with just httpd:
      [root@zabbix ~]# zabbix_get -s hrnpcm1 -p 10001 -k proc.num[,appat,,httpd]
      29

      but when queried for a more specific value it returns zero:
      [root@zabbix ~]# zabbix_get -s hrnpcm1 -p 10001 -k proc.num[,appat,,httpd.conf]
      0

      I know these exist because these are grepable from the command line:
      [root@hrnpcm1 root]# ps -fu appat | grep -c httpd.conf
      13

      I'm at a loss here for what can be done......

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        This is because the parameter is treated as Posix-style regular expression.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • denso
          Member
          • Sep 2005
          • 32

          #5
          irregular expression frustration

          on the system to be polled the reg expression works:

          [root@hrnpcm1 root]# ps -fu appat | grep -c -e "httpd\.c*"
          13

          but zabbix does not seem to like this:

          [root@zabbix ~]# zabbix_get -s hrnpcm1 -p 10001 -k proc.num[,appat,,"httpd\.c*"]
          0

          perhaps I am missing something.... could you look this over and perhaps give some advise ?
          Last edited by denso; 04-08-2006, 16:54.

          Comment

          • denso
            Member
            • Sep 2005
            • 32

            #6
            I am still having trouble with this issue

            I query from the server and have 2 different sets of apache to monitor:

            one uses an httpd.conf
            the other uses httpd_pls.conf

            I can get the value for a total httpd with:

            zabbix_get -s hrnpcm1 -p 10001 -k proc.num[,,,httpd]
            83

            but if i try to seprate them it fails

            zabbix_get -s hrnpcm1 -p 10001 -k proc.num[,,,httpd.conf]
            0

            zabbix_get -s hrnpcm1 -p 10001 -k proc.num[,,,httpd_pls.conf]
            0

            Comment

            • Alexei
              Founder, CEO
              Zabbix Certified Trainer
              Zabbix Certified SpecialistZabbix Certified Professional
              • Sep 2004
              • 5654

              #7
              ZABBIX didn't correctly process command lines under Linux 2.6.x. It seems that Linux changed format of /proc/pid/cmdline breaking our code at some point.

              Replace src/libs/zbxsysinfo/linux/proc.c with attached file and recompile to make it work.
              Attached Files
              Alexei Vladishev
              Creator of Zabbix, Product manager
              New York | Tokyo | Riga
              My Twitter

              Comment

              • djinn_fr22
                Member
                • Jan 2007
                • 54

                #8
                Hi,

                Does it mean with this patch I could use a regular expression to find a specific string:

                Is possible to get the memory of this process, by searching for the string "example" ??

                /jdk/bin/java -server -Xmx6096M -showversion -Ddisplay_name=example -Dcom.sun.management.jmxremote

                Thank you.

                Comment

                • Alexei
                  Founder, CEO
                  Zabbix Certified Trainer
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Sep 2004
                  • 5654

                  #9
                  Originally posted by djinn_fr22
                  Hi,

                  Does it mean with this patch I could use a regular expression to find a specific string:

                  Is possible to get the memory of this process, by searching for the string "example" ??

                  /jdk/bin/java -server -Xmx6096M -showversion -Ddisplay_name=example -Dcom.sun.management.jmxremote

                  Thank you.
                  Yes, absolutely!
                  Alexei Vladishev
                  Creator of Zabbix, Product manager
                  New York | Tokyo | Riga
                  My Twitter

                  Comment

                  • djinn_fr22
                    Member
                    • Jan 2007
                    • 54

                    #10
                    Thank you for your quick answer.

                    But can you give me an example, because it doesn't work, and I cannot find anything in the documentation.
                    I am trying to use proc.mem

                    Many thanks once again.

                    Comment

                    • djinn_fr22
                      Member
                      • Jan 2007
                      • 54

                      #11
                      [bug] proc.c

                      I finally manage to use the regular expression.
                      For the record, it works like that:
                      proc.num[,,,search_string] or proc.mem[,,,search_string]

                      But by testing it, I found this bug when I applied the proc.c file from this thread.

                      I am using a 2.6.9-42.ELsmp kernel with zabbix version 1.1.6

                      ps -ef|grep cupsd
                      root 20496 1 0 Feb04 ? 00:00:00 cupsd
                      xxxxx 25310 24200 0 14:02 pts/0 00:00:00 grep cupsd

                      Without the patch:
                      ./bin/zabbix_agentd -c conf/zabbix_agentd.conf -t proc.num[,,,cupsd]
                      proc.num[,,,cupsd] [u|1]


                      With the patch:
                      ./zabbix_agentd -c conf/zabbix_agentd.conf -t proc.num[,,,cupsd]
                      proc.num[,,,cupsd] [u|2]

                      Comment

                      • Alexei
                        Founder, CEO
                        Zabbix Certified Trainer
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Sep 2004
                        • 5654

                        #12
                        Hey, you forgot to calculate running zabbix_agentd which also has cupsd in its name!
                        Alexei Vladishev
                        Creator of Zabbix, Product manager
                        New York | Tokyo | Riga
                        My Twitter

                        Comment

                        • djinn_fr22
                          Member
                          • Jan 2007
                          • 54

                          #13
                          Thank you.

                          My brain is not working properly at the end of the week.

                          It works like a charm.

                          I don't think you can have the cpu utilization of a process in zabbix.
                          If it's true, is a limitation of the information you have in /proc or just a lack of time to implement this feature ?

                          Comment

                          • phredbroughton
                            Junior Member
                            • Jan 2007
                            • 4

                            #14
                            Originally posted by Alexei
                            ZABBIX didn't correctly process command lines under Linux 2.6.x. It seems that Linux changed format of /proc/pid/cmdline breaking our code at some point.

                            Replace src/libs/zbxsysinfo/linux/proc.c with attached file and recompile to make it work.
                            Did this make it into 1.1.6 release? If we apply this patch to 1.1.6, will it break anything else or lose any other changes?
                            I know, I know diff diff... Just hoping someone already knows the answer.

                            Comment

                            • StanZoid
                              Member
                              • Oct 2005
                              • 47

                              #15
                              I am having the same problem in 1.4--did this patch make it into the code line? If not, will this patch fix 1.4 as well?

                              Stanzoid

                              Comment

                              Working...