Ad Widget

Collapse

Count number files into a windows directory - Items

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ninval
    Junior Member
    • May 2013
    • 4

    #1

    Count number files into a windows directory - Items

    I know that a similar topic was discussed in another thread, but it does not work for zabbix 2.0.5


    Are you did maybe something like monitor the number of files in a directory?
    I have a situation that has a directory in Windows Server 2008, which is often changeable number of files in a directory (eg d: \ directory \ xyz \).

    Tell me how to build the item to show the number of files contained in the directory, or even if such a thing is possible?

    I tried to do it with the description of what is in this thread:

    but it does not work on the zabbix server 2.0.5

    My zabbix server is at version 2.0.5
    Agent for Windows is at version 2.0.6

    Send how to work on zabbix 2.0.5
  • Heilig
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2013
    • 366

    #2
    Try to upgrade zabbix server to the latest version.
    Last edited by Heilig; 10-05-2013, 09:58. Reason: corrected sentence

    Comment

    • Ninval
      Junior Member
      • May 2013
      • 4

      #3
      Originally posted by Heilig
      Try to upgrade zabbix server to the latest version.
      I picked up the zabbix version 2.0.6, but it did not work.
      Does not anyone have this item's which operates under zabbix 2.0.6?

      Comment

      • Heilig
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Mar 2013
        • 366

        #4
        Create a batch file (here you can find batch code example) on a windows server.
        Use UserParameter or schedule script executing and use zabbix_sender to send results into Zabbix.

        Comment

        • Ninval
          Junior Member
          • May 2013
          • 4

          #5
          I did so, zabbix_agentd.conf added two entries to the test

          UserParameter=dir_Count_Queue,DIR /A-D /B /S c:\SMTPSVC\Queue\ | FIND /C /V ""
          UserParameter=dir_Count_Queue1,DIR /A-D /B /S | FIND /C /V ""

          In zabbix server added 2 items

          description: dir_Count_Queue
          type: zabbix agent
          key: dir_Count_Queue[*]
          type: numeric
          interval: 20

          description: dir_Count_Queue1
          type: zabbix agent
          key: dir_Count_Queue1[c:\SMTPSVC\Queue\]
          type: numeric
          interval: 20

          something I do not want this to work, you help?

          Comment

          • Heilig
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Mar 2013
            • 366

            #6
            Check your UserParameters with zabbix_get utility and correct items key in zabbix frontend (should be "dir_Count_Queue" and "dir_Count_Queue1"). Details here.
            Also re-check that your command return only one number in all possible situation (for example if there no file in specified folder). Otherwise you'll get "ZBX_NOTSUPPORTED" for this item.

            Comment

            • Ninval
              Junior Member
              • May 2013
              • 4

              #7
              Success. I managed to do monitoring
              On the server you are monitoring the zabbix_agentd.conf add:
              UserParameter=dir.Count.SMTPSVC.Badmail,DIR /A-D /B /S K:\SMTPSVC\Badmail\ | FIND /C /V ""
              UserParameter=dir.Count.SMTPSVC.Drop,DIR /A-D /B /S K:\SMTPSVC\Drop\ | FIND /C /V ""
              UserParameter=dir.Count.SMTPSVC.Pickup,DIR /A-D /B /S K:\SMTPSVC\Pickup\ | FIND /C /V ""
              UserParameter=dir.Count.SMTPSVC.Queue,DIR /A-D /B /S K:\SMTPSVC\Queue\ | FIND /C /V ""

              On the server, add Zabbix item's:
              dir.Count.SMTPSVC.Badmail
              dir.Count.SMTPSVC.Drop
              dir.Count.SMTPSVC.Pickup
              dir.Count.SMTPSVC.Queue

              Sample item:
              description: GFI: Queue
              type: zabbix agent
              key: dir.Count.SMTPSVC.Queue
              type: Numeric (float)
              interval: 300

              Heilig Thank you for your help. Your advice is very usefull
              Last edited by Ninval; 15-05-2013, 14:13.

              Comment

              Working...