Ad Widget

Collapse

More Apache Monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gpmidi
    Member
    • Aug 2009
    • 62

    #16
    Originally posted by Akao
    file "/etc/zabbix/zabbixApacheUpdater.py", line 222, in ? data=parse(data=data)
    file "/etc/zabbix/zabbixApacheUpdater.py", line 75, in parse for (key,val) in csvobj:
    ValueError: need more than 1 value to unpack

    Anyone had this error?

    I executed:

    /usr/bin/python /etc/zabbix/ZabbixApacheUpdater.py -c 192.168.200.21 - z 192.168.200.10

    One is the zabbix server and the another one is the host that i want to control apache.
    Can you send me the output of 'wget -O - http://localhost/server-status?auto'?

    Comment

    • FireMail
      Junior Member
      • Mar 2010
      • 13

      #17
      still cant figure it out why it doesnt work.

      the configuration of the host:
      [ATTACH]2717[/ATTACH]


      and when i look at the hosts items, it just tells me that its not suppoted
      [ATTACH]2718[/ATTACH]


      the crontab call i use is:
      * * * * * /root/zabbix_scripts/fetch.py -z MONITORING -o TS -c TS


      do you see any problem?!

      Comment

      • Akao
        Junior Member
        • Mar 2010
        • 15

        #18
        Originally posted by gpmidi
        Can you send me the output of 'wget -O - http://localhost/server-status?auto'?
        Hi, thanks for the answer, it was a apache permission problem, now the output is quite similar that the FireMail one.

        /usr/bin/python /etc/zabbix/ZabbixApacheUpdater.py -c 192.168.200.21 - z 192.168.200.10
        zabbix_sender [14157]: DEBUG: Answer [{
        "response":"success",
        "info":"Processed 0 Failed 13 Total 13 Seconds spent 0.000926"}]
        Info from server: "Processed 0 Failed 13 Total 13 Seconds spent 0.000926"
        sent: 13; skipped: 0; total: 13
        Although in the configuration of items of zabbix the apache items appear with status Active and no Error, but they dont appear in Latest Data.
        Last edited by Akao; 23-03-2010, 09:55.

        Comment

        • FireMail
          Junior Member
          • Mar 2010
          • 13

          #19
          Originally posted by Akao
          Hi, thanks for the answer, it was a apache permission problem, now the output is quite similar that the FireMail one.
          yes - i am not the only one anymore

          Originally posted by Akao
          Although in the configuration of items of zabbix the apache items appear with status Active and no Error, but they dont appear in Latest Data.
          are you sure the status of the items of the server you assigned the template to is active? In the template itself they are active, when i assign them to a server they become inactive / not supported (as you can see in the screenshot posted above) after 5 minutes

          Comment

          • Akao
            Junior Member
            • Mar 2010
            • 15

            #20
            Originally posted by FireMail
            yes - i am not the only one anymore


            are you sure the status of the items of the server you assigned the template to is active? In the template itself they are active, when i assign them to a server they become inactive / not supported (as you can see in the screenshot posted above) after 5 minutes
            Yes, here is a print screen, i added the template some days ago and continue active but the items dont appear in latest data.



            Some news, i realized that zabbix agent port is 10050 and the default port of the script is 10051.

            So i put /usr/bin/python /etc/zabbix/ZabbixApacheUpdater.py -c 192.168.200.21 - z 192.168.200.10 -q 10050 and now the output is:

            /usr/bin/python /etc/zabbix/ZabbixApacheUpdater.py -c 192.168.200.21 - z 192.168.200.10 -q 10050
            zabbix_sender [14339]: DEBUG: Answer []
            sent: 13; skipped: 0; total: 13
            But all continues the same in Zabbix


            In crontab i have * * * * * /usr/bin/python /etc/zabbix/ZabbixApacheUpdater.py -c 192.168.200.21 - z 192.168.200.10 -q 10050 > /dev/null 2>&1
            Last edited by Akao; 23-03-2010, 10:40.

            Comment

            • FireMail
              Junior Member
              • Mar 2010
              • 13

              #21
              Originally posted by Akao
              Some news, i realized that zabbix agent port is 10050 and the default port of the script is 10051.

              So i put /usr/bin/python /etc/zabbix/ZabbixApacheUpdater.py -c 192.168.200.21 - z 192.168.200.10 -q 10050 and now the output is:



              But all continues the same in Zabbix


              In crontab i have * * * * * /usr/bin/python /etc/zabbix/ZabbixApacheUpdater.py -c 192.168.200.21 - z 192.168.200.10 -q 10050 > /dev/null 2>&1
              Code:
              MONITORING niko # /root/zabbix_scripts/fetch.py -z MONITORING -o 192.168.0.11 -c 192.168.0.11 -q 10050                                   
              zabbix_sender [3285]: DEBUG: Answer [ZBX_NOTSUPPORTED]
              sent: 20; skipped: 0; total: 20
              MONITORING niko # /root/zabbix_scripts/fetch.py -z MONITORING -o TS -c TS -q 10050
              zabbix_sender [3297]: DEBUG: Answer [ZBX_NOTSUPPORTED]
              sent: 20; skipped: 0; total: 20
              not better here ZBX_NOTSUPPORTED

              Comment

              • Akao
                Junior Member
                • Mar 2010
                • 15

                #22
                New x file case, call Mulder. It suddenly began working for me. But I dont know what i have touched.



                I checked the path to zabbix_sender, i had it in /usr/local/bin and i put in /usr/bin and /usr/sbin but it didnt change anything.

                I remove the template, i put it again...after some minutes looking for more info, i look into zabbix and the apache stats were there.

                Comment

                • FireMail
                  Junior Member
                  • Mar 2010
                  • 13

                  #23
                  damn now i am the only one left with that problem
                  so you dont use the other port you posted before, you use the default port?

                  //edit:
                  i am also wondering why you use an ZabbixApacheUpdater.py - did you rename the fetch.py?
                  Last edited by FireMail; 24-03-2010, 10:28.

                  Comment

                  • Akao
                    Junior Member
                    • Mar 2010
                    • 15

                    #24
                    Yes, at the end I use the default port and i just renamed the fetch.py .

                    Anyway, I think you have a different problem, my configuration of items, the status never changed to not supported, it was always active.

                    So I dont know what can be the solution.

                    Comment

                    • FireMail
                      Junior Member
                      • Mar 2010
                      • 13

                      #25
                      hmpf

                      thanks anyway, hope the auther of the plugin can help me somehow

                      Comment

                      • gpmidi
                        Member
                        • Aug 2009
                        • 62

                        #26
                        Originally posted by Akao
                        New x file case, call Mulder. It suddenly began working for me. But I dont know what i have touched.



                        I checked the path to zabbix_sender, i had it in /usr/local/bin and i put in /usr/bin and /usr/sbin but it didnt change anything.

                        I remove the template, i put it again...after some minutes looking for more info, i look into zabbix and the apache stats were there.
                        That's really weird. I wish I knew why that was happening... If it starts happening again you could try changing the Zabbix daemon to debug mode and checking it's logs for why it's refusing the data. In fact it may already be in the normal logs.
                        -Paul

                        Comment

                        • gpmidi
                          Member
                          • Aug 2009
                          • 62

                          #27
                          Debug Logs

                          Originally posted by FireMail
                          Code:
                          MONITORING niko # /root/zabbix_scripts/fetch.py -z MONITORING -o 192.168.0.11 -c 192.168.0.11 -q 10050                                   
                          zabbix_sender [3285]: DEBUG: Answer [ZBX_NOTSUPPORTED]
                          sent: 20; skipped: 0; total: 20
                          MONITORING niko # /root/zabbix_scripts/fetch.py -z MONITORING -o TS -c TS -q 10050
                          zabbix_sender [3297]: DEBUG: Answer [ZBX_NOTSUPPORTED]
                          sent: 20; skipped: 0; total: 20
                          not better here ZBX_NOTSUPPORTED
                          Check and see if there are any hints in the Zabbix Server logs. If not would it be possible to switch the daemon to debug mode? If so send me a copy of the debug logs after running it. You can email me directly using my name at gpmidi.net.

                          If this debug logs don't say why we can modify the program to not delete the file it sends. That will let us see exactly what it's refusing to send.
                          -Paul
                          Last edited by gpmidi; 26-03-2010, 16:34. Reason: Added another testing idea

                          Comment

                          • tgs
                            Junior Member
                            Zabbix Certified Specialist
                            • Jan 2009
                            • 10

                            #28
                            This script works for me.
                            My cron is:
                            ZabbixApacheUpdater.py -c manet -z 127.0.0.1
                            the name "manet" is the same name that I configure in the web frontend.

                            Comment

                            • gpmidi
                              Member
                              • Aug 2009
                              • 62

                              #29
                              Nice

                              Originally posted by tgs
                              This script works for me.
                              My cron is:
                              ZabbixApacheUpdater.py -c manet -z 127.0.0.1
                              the name "manet" is the same name that I configure in the web frontend.
                              That's Sweet

                              Comment

                              • FireMail
                                Junior Member
                                • Mar 2010
                                • 13

                                #30
                                Originally posted by gpmidi
                                Check and see if there are any hints in the Zabbix Server logs. If not would it be possible to switch the daemon to debug mode? If so send me a copy of the debug logs after running it. You can email me directly using my name at gpmidi.net.

                                If this debug logs don't say why we can modify the program to not delete the file it sends. That will let us see exactly what it's refusing to send.
                                -Paul
                                hi paul,

                                i sent you the debug log since the server logs dont show anything.
                                Maybe my setup is just weird or the agentd isnt correctly configured?

                                We have X servers - each running agentd.
                                The server "MONITORING" (DNS via /etc/hosts: "MONITORING", local IP Adress: 192.168.0.10) runs the zabbix_server which uses the DB on "TS" (DNS via /etc/hosts: "TS", local IP Adress: 192.168.0.11) to store the information. The web frontend is also located on "TS".

                                Heres the configuration of the zabbix_server on "MONITORING"
                                # This is config file for ZABBIX server process
                                # To get more information about ZABBIX,
                                # go http://www.zabbix.com

                                ############ GENERAL PARAMETERS #################

                                # This defines unique NodeID in distributed setup,
                                # Default value 0 (standalone server)
                                # This parameter must be between 0 and 999
                                #NodeID=0

                                # Number of pre-forked instances of pollers
                                # Default value is 5
                                # This parameter must be between 0 and 255
                                #StartPollers=5

                                # Number of pre-forked instances of IPMI pollers
                                # Default value is 0
                                # This parameter must be between 0 and 255
                                #StartIPMIPollers=0

                                # Number of pre-forked instances of pollers for unreachable hosts
                                # Default value is 1
                                # This parameter must be between 0 and 255
                                #StartPollersUnreachable=1

                                # Number of pre-forked instances of trappers
                                # Default value is 5
                                # This parameter must be between 0 and 255
                                #StartTrappers=5

                                # Number of pre-forked instances of ICMP pingers
                                # Default value is 1
                                # This parameter must be between 0 and 255
                                #StartPingers=1

                                # Number of pre-forked instances of discoverers
                                # Default value is 1
                                # This parameter must be between 0 and 255
                                #StartDiscoverers=1

                                # Number of pre-forked instances of HTTP pollers
                                # Default value is 1
                                # This parameter must be between 0 and 255
                                #StartHTTPPollers=1

                                # Listen port for trapper. Default port number is 10051. This parameter
                                # must be between 1024 and 32767

                                #ListenPort=10051

                                # Source IP address for outgouing connections
                                SourceIP=192.168.0.10

                                # Listen interface for trapper. Trapper will listen all network interfaces
                                # if this parameter is missing.

                                ListenIP=192.168.0.10

                                # How often ZABBIX will perform housekeeping procedure
                                # (in hours)
                                # Default value is 1 hour
                                # Housekeeping is removing unnecessary information from
                                # tables history, alert, and alarms
                                # This parameter must be between 1 and 24

                                #HousekeepingFrequency=1

                                # How often ZABBIX will try to send unsent alerts
                                # (in seconds)
                                # Default value is 30 seconds
                                SenderFrequency=30

                                # Uncomment this line to disable housekeeping procedure
                                #DisableHousekeeping=1

                                # Specifies debug level
                                # 0 - debug is not created
                                # 1 - critical information
                                # 2 - error information
                                # 3 - warnings (default)
                                # 4 - for debugging (produces lots of information)

                                DebugLevel=3

                                # Specifies how long we wait for agent response (in sec)
                                # Must be between 1 and 30
                                Timeout=5

                                # Specifies how many seconds trapper may spend processing new data
                                # Must be between 1 and 30
                                #TrapperTimeout=5

                                # After how many seconds of unreachability treat a host as unavailable
                                #UnreachablePeriod=45

                                # How ofter check host for availability during the unreachability period
                                #UnavailableDelay=15

                                # How ofter check host for availability during the unavailability period
                                #UnavailableDelay=60

                                # Name of PID file

                                PidFile=/var/run/zabbix/zabbix_server.pid

                                # Name of log file
                                # If not set, syslog is used

                                LogFile=/var/log/zabbix/zabbix_server.log

                                # Maximum size of log file in MB. Set to 0 to disable automatic log rotation.
                                #LogFileSize=1

                                # Location for custom alert scripts
                                AlertScriptsPath=/home/zabbix/bin/

                                # Location of external scripts
                                #ExternalScripts=/etc/zabbix/externalscripts

                                # Location of fping. Default is /usr/sbin/fping
                                # Make sure that fping binary has root permissions and SUID flag set
                                #FpingLocation=/usr/sbin/fping

                                # Location of fping6. Default is /usr/sbin/fping6
                                # Make sure that fping binary has root permissions and SUID flag set
                                #Fping6Location=/usr/sbin/fping6

                                # Temporary directory. Default is /tmp
                                #TmpDir=/tmp

                                # Frequency of ICMP pings (item keys 'icmpping' and 'icmppingsec'). Defauls is 60 seconds.
                                #PingerFrequency=60

                                # Database host name
                                # Default is localhost

                                DBHost=192.168.0.11

                                # Database name
                                # SQLite3 note: path to database file must be provided. DBUser and DBPassword are ignored.
                                DBName=XXXXXXXXX

                                # Database user

                                DBUser=XXXXXXX

                                # Database password
                                # Comment this line if no password used

                                DBPassword=XXXXXXX

                                # Connect to MySQL using Unix socket?

                                #DBSocket=/tmp/mysql.sock
                                Heres the configuration of the zabbix_agentd on "TS"
                                # This is config file for zabbix_agentd
                                # To get more information about ZABBIX, go http://www.zabbix.com

                                ############ GENERAL PARAMETERS #################

                                # List of comma delimited IP addresses (or hostnames) of ZABBIX servers.
                                # No spaces allowed. First entry is used for sending active checks.
                                # Note that hostnames must resolve hostname->IP address and
                                # IP address->hostname.

                                Server=192.168.0.10

                                # Server port for sending active checks

                                #ServerPort=10051

                                # Unique hostname. Required for active checks.

                                Hostname=TS

                                # Listen port. Default is 10050

                                #ListenPort=10050

                                # IP address to bind agent
                                # If missing, bind to all available IPs

                                ListenIP=192.168.0.11

                                # Source IP address for outgouing connections
                                SourceIP=192.168.0.11

                                # Number of pre-forked instances of zabbix_agentd.
                                # Default value is 5
                                # This parameter must be between 1 and 16

                                StartAgents=5

                                # How often refresh list of active checks. 2 minutes by default.

                                #RefreshActiveChecks=120

                                # Disable active checks. The agent will work in passive mode listening server.

                                #DisableActive=1

                                # Enable remote commands for ZABBIX agent. By default remote commands disabled.

                                #EnableRemoteCommands=1

                                # Specifies debug level
                                # 0 - debug is not created
                                # 1 - critical information
                                # 2 - error information
                                # 3 - warnings (default)
                                # 4 - for debugging (produces lots of information)

                                DebugLevel=3

                                # Name of PID file

                                PidFile=/var/run/zabbix/zabbix_agentd.pid

                                # Name of log file.
                                # If not set, syslog will be used

                                LogFile=/var/log/zabbix/zabbix_agentd.log

                                # Maximum size of log file in MB. Set to 0 to disable automatic log rotation.
                                #LogFileSize=1

                                # Spend no more than Timeout seconds on processing
                                # Must be between 1 and 30

                                Timeout=3

                                ####### USER-DEFINED MONITORED PARAMETERS #######
                                # Format: UserParameter=<key>,<shell command>
                                # Note that shell command must not return empty string or EOL only
                                #UserParameter=system.test,who|wc -l
                                ### Set of parameter for monitoring MySQL server (v3.23.42 and later)
                                ### Change -u<username> and add -p<password> if required
                                #UserParameter=mysql.ping,mysqladmin -uroot ping|grep alive|wc -l
                                #UserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T"
                                #UserParameter=mysql.threads,mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q"
                                #UserParameter=mysql.questions,mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S"
                                #UserParameter=mysql.slowqueries,mysqladmin -uroot status|cut -f5 -d":"|cut -f1 -d"O"
                                #UserParameter=mysql.qps,mysqladmin -uroot status|cut -f9 -d":"
                                #UserParameter=mysql.version,mysql -V

                                Comment

                                Working...