Ad Widget

Collapse

Count number files into a windows directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Josh
    Junior Member
    • Dec 2011
    • 10

    #16
    I am almost positive it doesnt, I just ran the script with an output to a text file and it was just the number with no extra lines, tabs or spaces.

    Comment

    • qix
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Oct 2006
      • 423

      #17
      Just try setting the type...
      With kind regards,

      Raymond

      Comment

      • Josh
        Junior Member
        • Dec 2011
        • 10

        #18
        I changed it to character and it did in fact log the unable to set job info: [0x00000057] error message

        EDIT: I just retested this on a win 2008 server and it works perfect on those, not sure whats happening :/
        Last edited by Josh; 08-12-2011, 21:51.

        Comment

        • qix
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Oct 2006
          • 423

          #19
          Te agent is tripping over the Vbs for some reason. You could try to increase the logging verbosity on the agent and retest, maybe the logging will give you more insights.
          With kind regards,

          Raymond

          Comment

          • Zaniwoop
            Senior Member
            • Jan 2010
            • 232

            #20
            what happens if you run the FileCount.vbs from the command prompt?
            What value does it return?

            Comment

            • Josh
              Junior Member
              • Dec 2011
              • 10

              #21
              It outputs the number of files. I even ran it in CMD with the output being sent to a text file and all that was sent was the number, no extra characters or anything so I know if it giving a value supported by Zabbix.

              Comment

              • Josh
                Junior Member
                • Dec 2011
                • 10

                #22
                Ok, decided to go a different route. I am now running the VBscript as a scheduled task on the machine which outputs the results to a text file on another machine which zabbix then reads and looks to see if the last value is greater than X number of files. The only issue I have is this only looks at the root of the file and nothing in subfolders. Anyone have a quick solution to make the script look in subfolders?

                EDIT: Wrote a script to find the file count of each folder and subfolder which wrote to a log file if too many files were found, then made a log file monitor in zabbix to watch that file for new entries. Not sure why this 2000 server was being so picky but found a way around it.
                Last edited by Josh; 21-12-2011, 21:51.

                Comment

                • Gert Vanderstukken
                  Junior Member
                  • Mar 2011
                  • 5

                  #23
                  I have simular errors (unable to set job info: [0x00000057] The parameter is incorrect.) after upgrading agents from 1.8.5 to 1.8.8/1.8.9 or 1.8.10.

                  simply replacing zabbix_agentd.exe with the newer version gives me these errors on Windows 2000 machines. I reverted them back to 1.8.5 and all is OK again.

                  On W2K3 and W2K8 => no problems. I run 1.8.10 on them without issues.

                  What changed after 1.8.5 (or possibly 1.8.6/1.8.7, I did not test those versions)?

                  Comment

                  • Toodach
                    Junior Member
                    • Jun 2012
                    • 1

                    #24
                    Count number files mdeamon

                    HI,

                    I did the same thing as Zaniwoop , and it seems not working.
                    When i execute the script with paramaters //nologo $1 (cmd).
                    I've go an error at lign 5 caract 1.
                    Can you help me please.

                    Thanks.

                    Comment

                    • jcvalencia
                      Junior Member
                      • Jul 2012
                      • 3

                      #25
                      It seems like a W2k issue in the agent, same problem here. It returns the same error on any external execution, for every UserParameter, even running a simple system.run["dir"] on a zabbix_get from the server.

                      Using agent version 1.8.10

                      Comment

                      • jcvalencia
                        Junior Member
                        • Jul 2012
                        • 3

                        #26
                        Works ok in 1.8.5, any clue? Please some zabbix dev could figure it out and fix this?

                        Comment

                        • marcel
                          Senior Member
                          Zabbix Certified Specialist
                          • Oct 2010
                          • 112

                          #27
                          I have implemented a Proof Of Concept in this patch:


                          patch against 2.0.4 sources
                          Zabbix Certified Specialist for Large Environments since 12/2010

                          Comment

                          • be636027
                            Junior Member
                            • Apr 2014
                            • 2

                            #28
                            apply patch

                            How do I apply this patch?

                            Originally posted by marcel
                            I have implemented a Proof Of Concept in this patch:


                            patch against 2.0.4 sources

                            Comment

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

                              #29
                              An easy solution for windows envs should be:

                              system.run[dir /A-d "C:\failed\logs\" | find /c "/"]

                              And trigger like:
                              {hostname:system.run[dir /A-d "C:\failed\logs\" | find /c "/"].str("File Not Found")}=0

                              Regards.
                              Last edited by angelhc; 21-05-2014, 14:54.
                              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

                              Working...