Ad Widget

Collapse

Monitor folder size

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jordibrand
    Junior Member
    • Jan 2015
    • 16

    #16
    I've done the same thing on another server 2008 and a server 2012, it's working just fine. I think it's something on that specific server that's not working or incorrect. I get back to you in a few days.

    Answer to question A:
    Attached Files

    Comment

    • jordibrand
      Junior Member
      • Jan 2015
      • 16

      #17
      Is it possible that the script takes to long to run? I can imagine if the folder size is very large, there's a timeout and you get no output. If so, how/where can I expand that time?

      Comment

      • simoon
        Junior Member
        • May 2014
        • 8

        #18
        Check Timeout parameter in agent config.
        Max value is 30.

        Comment

        • aib
          Senior Member
          • Jan 2014
          • 1615

          #19
          There are two ways to solve your problem with long running script.
          1) Increase Timeout= to maximum number (30 sec) on both side (server side and client side) in config files and restart server and client.
          Code:
          Timeout=30
          2) Change the way of collecting data.
          - Change Item type from Zabbix agent to Trapper. It changes the way of collecting data from "querying" to "accept incoming"
          - Create a local script on client side and make it starts regularly (cron or scheduler). Use zabbix_sender inside of script to send data from client to server

          All information about zabbix_sender, script, etc can be collected on Zabbix Manual page or on this forum.
          Sincerely yours,
          Aleksey

          Comment

          • jordibrand
            Junior Member
            • Jan 2015
            • 16

            #20
            Everything is working fine now! I've increased the timeout on every server to 30 seconds, every item is working.
            Thanks to everyone!!

            Comment

            • aib
              Senior Member
              • Jan 2014
              • 1615

              #21
              Well done!
              Sincerely yours,
              Aleksey

              Comment

              • jordibrand
                Junior Member
                • Jan 2015
                • 16

                #22
                Last question
                I'm monitoring about 100 folders, 2 folders are giving an error in powershell:
                Path of folder or files are too long. The file has to be less than 260 characters and the folder less than 248 characters.
                Is there a workaround, or isn't it going to work at all with powershell?

                Comment

                • aib
                  Senior Member
                  • Jan 2014
                  • 1615

                  #23
                  Originally posted by jordibrand
                  Last question
                  I'm monitoring about 100 folders, 2 folders are giving an error in powershell:
                  Path of folder or files are too long. The file has to be less than 260 characters and the folder less than 248 characters.
                  Is there a workaround, or isn't it going to work at all with powershell?
                  From top of my head - map long path to individual drive and check that drive for free space.
                  Code:
                  subst M: c:\users\geek\desktop
                  and then check folder.size[M:\]
                  Sincerely yours,
                  Aleksey

                  Comment

                  • jordibrand
                    Junior Member
                    • Jan 2015
                    • 16

                    #24
                    It was that simpel Thanks!

                    Comment

                    • troffasky
                      Senior Member
                      • Jul 2008
                      • 567

                      #25
                      Inconsistent :-(

                      I am using the above Powershell one-liner on Windows 2008 and I've noticed holes in the data, but when I test it it's always fine. So I ran this:

                      Code:
                      # while sleep 30 ; do zabbix_get -s theserver -k folder.size[C:/temp/] ; done
                      and I get something like this:

                      Code:
                      59467878
                      59467878
                      59467878
                      59467878
                      ZBX_NOTSUPPORTED
                      ZBX_NOTSUPPORTED
                      ZBX_NOTSUPPORTED
                      59467878
                      59467878
                      59467878
                      Seems like it returns not supported for whatever reason and that probably causes it to be disabled [further enlarging the hole]. I am logging with level 3 and there is nothing in the log file of any interest.

                      Has anybody else seen similar behaviour?

                      Comment

                      • coreychristian
                        Senior Member
                        Zabbix Certified Specialist
                        • Jun 2012
                        • 159

                        #26
                        troffasky,

                        It could be a timeout, or it could be returning an invalid data set. If you look in the zabbix server/proxy logs do you see any errors for your system and that metric?

                        Comment

                        • troffasky
                          Senior Member
                          • Jul 2008
                          • 567

                          #27
                          Yeah, the error is that it's not supported :-S

                          Code:
                          3354:20160411:144831.583 item [theserver:folder.size[c:/temp/]] became not supported: Not supported by Zabbix Agent
                          3353:20160411:151630.213 item [theserver:folder.size[c:/temp/]] became supported
                          3353:20160411:152031.550 item [theserver:folder.size[c:/temp/]] became not supported: Not supported by Zabbix Agent
                          3342:20160411:152627.994 item [theserver:folder.size[c:/temp/]] became supported
                          I am going to try turning logging up to 4 but it does produce a ludicrous quantity of information. Really there needs to be a logging level 3.5.

                          Comment

                          • coreychristian
                            Senior Member
                            Zabbix Certified Specialist
                            • Jun 2012
                            • 159

                            #28
                            Yeah was hoping it would have more detail, what version of Zabbix Server are you running? Newer versions have a bit more detail in the logs/web ui usually.

                            That said it usually is either indicative of a timeout or invalid data being returned.

                            Comment

                            • angelhc
                              Senior Member
                              Zabbix Certified Specialist
                              • Nov 2009
                              • 226

                              #29
                              A simple way to monitor folder size is create a item like this :

                              system.run[powershell -noprofile -command "(Get-ChildItem -r C:\log | Measure-Object -property length -sum |select sum).sum"]

                              No need to deploy on each server a new line on the configuration file.

                              Regards!
                              Number of hosts 1600,Number of items +90k,Number of triggers +22k, Number of users +100, New values per second +1270

                              http://zabbixes.wordpress.com/

                              Comment

                              • troffasky
                                Senior Member
                                • Jul 2008
                                • 567

                                #30
                                Running 2.2. Will start testing whatever version of Zabbix comes with Ubuntu 16.04 shortly.

                                I didn't really get to the bottom of why the data wasn't always reported back. The issue only seems to occur one or so every 24h so it's not a massive deal.

                                Comment

                                Working...