Ad Widget

Collapse

Monitorring Print Queues on Windows Servers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Argon0
    Member
    • Mar 2023
    • 51

    #1

    Monitorring Print Queues on Windows Servers

    Hi, relatively new to Zabbix, have installed lates version, and got my first host added (a print server). I want to monitor and graph trends on various counters for each of the (395) print queues on the print server, as well as the services associated.

    Service sorted (monitorring and alerting on LPD service in this case).

    Print Queues themselves...I know the counters I want to graph (e.g. Jobs on WIn32_printers or Win32_PerfFormattedData_Spooler_PrintQueue, either work - but the first runs very slow in powershell). So it shouldn't be too difficult.. But I'm 2 days in and not there yet - I THINK I'm on the right track (Was going to use WMI.Get and create all the discovery rules/templates/items myself), but stumbled on the integrations area, and then found https://www.zabbix.com/integrations/windows#3rd_party - which looks like it lists multiple ways to do the same thing...

    So far I'm looking at:
    So I'm going to try the latter first. It uses VBS scripts on the Windows Server...

  • Argon0
    Member
    • Mar 2023
    • 51

    #2
    So, the windows-zabbix plugin needs additional documenation - do you need to put quotes around the location of the vbs scripts, if there is a space in the name (I suspect you do)?

    Yup you do... Having run the csript from the command line. But it seems to only return the printer queue names so far, maybe the template does more?​

    Comment

    • Argon0
      Member
      • Mar 2023
      • 51

      #3
      I get the feeling this plugin isn't complete <groan>.And hasn't been worked on for years.

      Comment

      • Argon0
        Member
        • Mar 2023
        • 51

        #4
        And doesn't seem to work anyway..So onto the next one... PHD..

        Comment

        • Argon0
          Member
          • Mar 2023
          • 51

          #5
          Which ALSO is designed for Zabbix 3.x Has much changed in this respect since?

          Comment

          • Argon0
            Member
            • Mar 2023
            • 51

            #6
            GREAT.. created the template - looks about right, but it's in XML, and needs to be in YAML.. <Groan> Is there a converter?

            Comment

            • Argon0
              Member
              • Mar 2023
              • 51

              #7
              So.. is Zabbix still live? Why are the integrations so out of date? The PDH to Zabbix integration looks really good has created an xml that looks fine to me. When converted to YAML (by an online tool), the YAML looks very similar to one exported, except it's not got any UUIDs in it.

              It fails on the
              Invalid tag "/zabbix_export": unexpected tag "template_groups"
              Which is confusing....As a working one I exported has exactly this the same syntax.... I attach the YAML... Is there any documentation on the YAML and/or a converter from the old XML specifit to Zabbix available?​

              Original xml attqached. YAML version is too big, and the forum won't let me attach .yaml files anyway.
              Attached Files

              Comment


              • tim.mooney
                tim.mooney commented
                Editing a comment
                Zabbix is open source and can be extended by users to solve problems that are specific to that user's workplace or environment. There aren't built-in monitors for every piece of hardware on the planet. The developers tend to focus on the most-requested stuff first, so if you have a less-common monitoring need, it may be necessary to create some custom items. Being extensible to solve monitoring needs beyond the built-in options is one of Zabbix's strengths.

                The "integration" you're looking at is probably user-contributed. If you're familiar with open-source software, you should understand that there might be many different reasons why something that a user contributed isn't kept up to date. Maybe their site is perfectly happy on an old version of Zabbix, so they haven't upgraded in a long time. Maybe the user that developed it was promoted or works in a different area, so they no longer work on monitoring. Maybe their company was bought by another company and they were forced to switch to the parent company's monitoring solution. The reasons go on and on, but either way: don't use user-contributed "plug ins" to judge the health of an open-source software product.
            • Argon0
              Member
              • Mar 2023
              • 51

              #8
              So here is a version - I've had to change the extension to xml
              Attached Files

              Comment

              • Argon0
                Member
                • Mar 2023
                • 51

                #9
                <argh> So.. the script created a file encoded to UTF16 LE BOM, and the first thing in the file said
                <?xml version="1.0" encoding="UTF-8"?>
                Changing the encoding in Notepad++ and importing still didn't work ('but this was an empty /name/ field - which was fairly easy to find).

                Did that and now it has imported.. Now to see what it has created...

                Comment

                • Argon0
                  Member
                  • Mar 2023
                  • 51

                  #10
                  Now the discovery rule says: "Unknown metric pdh2zbx.discovery" Which I think is defined in Macros as : {$PDH2ZABBIX_CMD}.. But I'm... not sure.. Maybe it needs to be defined elsewhere? In the Agent2.conf file?

                  Comment

                  • Argon0
                    Member
                    • Mar 2023
                    • 51

                    #11
                    Well, I've finally got some (usable?) data into Zabbix about the Printers. an additional 3500+ items associated with my print server.
                    Couple of points.
                    1) add the line
                    UserParameter=pdh2zbx.discovery[*],Powershell.exe -File "c:\zabbix\pdh2zabbix.ps1" -mode discovery "$1"
                    to the agent2.conf file on the Host in the Zabbix Agent 2 directory

                    2) The SPEACH MARKS (") around the $1 are what make it work - was running into probs with the space in the counter until I cottoned on to that.

                    Then the key that the template created started working.Which populated all the items..

                    Now to break.. And come back to add graphs tomorrow... If I can work out how to do that!!!

                    Comment

                    • Argon0
                      Member
                      • Mar 2023
                      • 51

                      #12
                      (AND, as I hoped/understood, all the items have graphs, so now to build triggers/alerts and dashboards!)

                      Comment

                      • bjohob
                        Junior Member
                        • May 2024
                        • 1

                        #13
                        I'm working on the same thing. I've added all queues from pref counters (no need for scripts). Just created a discovery for the Print Queue counter and then added item prototypes for Jobs, Out of paper and so on. I'm still in the early stages, but looks to be working so far.

                        Comment


                        • ZigbeeZabbix
                          ZigbeeZabbix commented
                          Editing a comment
                          This sounds great! Are you able to share your template as I'm looking for the exact same functionality and seems pointless to duplicate efforts. Thanks!
                      Working...