1 2 Previous Next 21 Replies Latest reply on Aug 30, 2017 5:05 PM by Ramassh Theivendran

    Can Patrol use Web services to monitor systems?

    Sudhir Bhatnagar
      Share This:

      I am a newbie to Patrol. So, my apologies in advance for ignorance.
      I am working on KM that uses SNMP (via PSL) to gather information. Now if the Entity MIB is not available on the systems (Intel Processor), can I gather the same information using Web Services? Please point me to any write-up on this!

      Thanks to all.

        • 1. RE: Can Patrol use Web services to monitor systems?

          Well it sounds like you said you were using PSL snmp...() functions to get information from a device, host or so forth. Typically the way that I have used snmp in the past is to open a session to the name or ipaddress and then use the snmp funtions once the session is open. These functions do work with the MIB variable so I am not certain that you could use the same scripting for your non-mib devices.

          I know there are a couple of web experts who traverse devcon, hopefully they can answer your questions. The only thing I can offer is an example script that uses snmp_get:

          row_ele=get&#40;&quot;sid&quot;&#41;;<br />print&#40;&quot;\nDNS name is&#58; &quot;,row_ele&#41;;<br />session=snmp_open&#40;row_ele,&quot;&quot;,&quot;mname&quot;,&quot;1000&quot;,&quot;&quot;,161&#41;;<br />print&#40;&quot;\n1-session variable is&#58;&quot;,session&#41;;<br />print&#40;&quot;\n&quot;&#41;;<br /><br />systemoid=snmp_get&#40;session,&quot;.x.x.x.x.x.x.x.x.x&quot;&#41;;<br />print&#40;&quot;\n2-systemoid and errno are &quot;,systemoid,errno&#41;;<br />print&#40;&quot;\n&quot;&#41;;<br /><br />systemoid=nthargf&#40;systemoid,3&#41;;<br />print&#40;&quot;\n3-system oid is&quot;,systemoid&#41;;<br />print&#40;&quot;\n&quot;&#41;;<br />if&#40;grep&#40;&quot;476&quot;,systemoid&#41; != &quot;&quot;&#41;<br />   &#123;<br />   print&#40;&quot;\nWe got a Leibert\n&quot;&#41;;<br />print&#40;&quot;\n&quot;&#41;;<br /># populate the Leibert OIDs<br />   run_time_remaining = &quot;.x.x.x.x.x.x.xx.x.x.x.x&quot;;<br />   time_on_battery = &quot;.x.x.x.x.x.x..x.x.x.x.x&quot;;<br />   ups_type = &quot;leibert&quot;;<br />   &#125;<br /><br />if&#40;grep&#40;&quot;318&quot;,systemoid&#41; != &quot;&quot;&#41;<br />   &#123;<br />   print&#40;&quot;\n5-We got a APC\n&quot;&#41;;<br />print&#40;&quot;\n&quot;&#41;;<br /># populate the Leibert OIDs<br />   run_time_remaining = &quot;.x.x.x.x.x.x.xx.x.x.x.x&quot;;<br />   time_on_battery = &quot;.x.x.x.x.x.x.xx.x.x.x.x.x.x.x&quot;;<br />   temperature = &quot;.x.x.x.x.x.x.xx.x.x.x.x.x.x&quot;;<br />   input_line_voltage = &quot;.x.x.x.x.x.x.xx.x.x.x.x&quot;;<br />   ups_type = &quot;apc&quot;;<br />   &#125;<br /><br /># temp cannot be done at site which are Leibert UPS&#41;<br />if&#40;ups_type == &quot;apc&quot;&#41;<br />   &#123;<br />   value=snmp_get&#40;session,temperature&#41;;<br />   val = error_check&#40;value&#41;;<br />      if&#40;pass == 1&#41;<br />         &#123;<br />         # convert from C to F<br />         val= val * 1.8 + 32;<br />         val=ntharg&#40;val,&quot;1&quot;,&quot;.&quot;&#41;;<br />         set&#40;&quot;../Temperature/value&quot;, val&#41;;<br />         &#125;<br /># Line input voltage cannot be done at site which are Leibert UPS&#41;<br />      value=snmp_get&#40;session,input_line_voltage&#41;;<br />      val = error_check&#40;value&#41;;<br />      if&#40;pass == 1&#41;<br />         &#123;   <br />         set&#40;&quot;../Input_Line_Voltage/value&quot;, val&#41;;<br />         &#125;<br />   &#125;<br /><br />   value=snmp_get&#40;session,run_time_remaining&#41;;<br />   val = error_check&#40;value&#41;;<br />   <br />      if&#40;pass == 1&#41;<br />      &#123;<br />      if&#40;ups_type == &quot;apc&quot;&#41;<br />         &#123;<br />         # convert form time ticks to minutes<br />         val = val /100 / 60;<br />         val=ntharg&#40;val,&quot;1&quot;,&quot;.&quot;&#41;;<br />         &#125;<br />      set&#40;&quot;../Run_Time_Remaining/value&quot;, val&#41;;<br />      &#125;<br /><br />   value=snmp_get&#40;session,time_on_battery&#41;;<br />   val = error_check&#40;value&#41;;<br />   if&#40;pass == 1&#41;<br />      &#123;<br />      if&#40;ups_type == &quot;apc&quot;&#41;<br />         &#123;<br />         # convert form time ticks to minutes<br />         val = val /100 / 60;<br />         val=ntharg&#40;val,&quot;1&quot;,&quot;.&quot;&#41;;<br />         &#125;<br />      # convert form time ticks to minutes<br />      val = val /100 / 60;<br />      val=ntharg&#40;val,&quot;1&quot;,&quot;.&quot;&#41;;<br />      set&#40;&quot;../Time_On_Battery/value&quot;, val&#41;;<br />      &#125;

           

          • 2. RE: Can Patrol use Web services to monitor systems?
            Sudhir Bhatnagar

            Susan,
            Thanks for your reply. Actually, my task is to replace the SNMP instrumentation with Web Services (using SOAP or HTTP Get /POST).

            The system information is available via Web services, and I want to develop a KM that will get the information using Web services instead of via SNMP.

            Sudhir Bhatnagar

            • 3. RE: Can Patrol use Web services to monitor systems?

              Hi Sudhir,

              I suppose you are reffering to this document :
              http://www.intel.com/technology/manage/downloads/ws_management.pdf

              Please also read :
              http://www.dmtf.org/newsroom/newsletter/2004/08/page6
              and
              http://msdn.microsoft.com/webservices/community/workshops/default.aspx

              As you will find out, this is still a protocol in development. And I am not aware of any implementation up to this day. Are you really already using WS-Services ?

              In the meanwhile, you could indeed use SNMP or WBEM.

              Best regards,

              Laurent

              • 4. RE: Can Patrol use Web services to monitor systems?

                Sorry, I actually meant WS-Management instead of WS-Services, of course.

                • 5. RE: Can Patrol use Web services to monitor systems?
                  Sudhir Bhatnagar

                  Hi Laurent,

                  Thanks for your reply. Ideally, yes. That's what I was looking for. But since there is no implementation available, I am interested in exploring WBEM. Have you got any sample KM that's WBEM based.

                  Since, I just started this I don't know much about Knowledge Modules (KM). Is there a way develop a KM, that can poll for management data using an http service that return xml. Currently, the KM seem to be using SNMP to get Entit MIB.

                  Sudhir Bhatnagar

                  • 6. RE: Can Patrol use Web services to monitor systems?

                    Hi,

                    I'll have to gather some code together. But my code is currently limited to the Windows platform. Is that a problem for you ? Also, for WBEM, are you working locally or remotely ? I have samples of both codes, but they should be slightly edited before I'll send them to you.

                    Also, you could have a look at the following topic :
                    http://communities.bmc.com/communities/message/44456#44456

                    Be sure to download the second release of the KM. You could use it as a base to parse your HTML or XML code.

                    I should update this KM within the coming weeks to add HTTP Proxy support.

                    Kind regards,

                    Laurent

                    • 7. RE: Can Patrol use Web services to monitor systems?
                      Sudhir Bhatnagar

                      Thanks. Windows platform is fine. That's what we have. So,  this would be gretaly appreciated. We are gathering information for all systems within our network (LAN).


                      Sudhir Bhatnagar

                      • 8. RE: Can Patrol use Web services to monitor systems?

                        Hi,

                        I'm sorry to repeat myself, but are you using WBEM locally or remotely ? The code is, of course, rather different. And I unfortunately don't have much time to edit the current code to present it to you.

                        Is the URL KM of any help ? Do you need more help about this ?

                        I'll try to find some time to edit the WBEM/WMI code tomorrow. I'll just send a working sample.

                        Best regards,

                        Laurent

                        • 9. RE: Can Patrol use Web services to monitor systems?

                          Also, Dont forget that there is a WMI wizard of sorts included with the standard NT KM. Its not the best thing in the world, but if all you are doing is running simple queries, then it works OK.

                          D

                          • 10. RE: Can Patrol use Web services to monitor systems?

                            Hi Dan,

                            I have never used the WMI wizard a lot, but could you please confirm whether it exclusively works locally ? Is there a way to send a WMI request to a remote host with the WMI Wizard ?

                            Regs,

                            Laurent

                            • 11. RE: Can Patrol use Web services to monitor systems?

                              To be honest, after a rather painful experience trying to get the earlier versions of the WBEM km to work in a stable way, I have avoided it like the plague and always rolled my own when WMI information is needed in patrol. However, in the newer versions of Patrol, there is a WMI Wizard, (In a similar vain to the perfmon wizard), but it has its limitations. For example, its expects your queries to return a numeric value, and it looks like it will only run local queries.

                              (If the wbem KM could run remote qureies out of the box, it would be doing half of the job of PatrolExpress!) I suppose it could be done, but ensureing that the right level of permission exist in the environment for the remote queries to work properly would be a little bit of a support nightmare.

                              D

                              • 12. RE: Can Patrol use Web services to monitor systems?

                                Hi Dan,

                                I indeed have had the same experience. The WMI Wizard is not the best KM BMC has ever released.
                                In fact, I prefer to use Bertrand Martin's solution, which is based on a VB script. I also like to develop my own KM, so as to have 100% control about what and how I collect, and I am not limited to numeric values.

                                I also wrote a document about how to support remote WMI queries in a Windows environment, about which rights you should give and which ports should be open, etc... I will probably also include this document with a sample km.

                                Best regards,

                                Laurent

                                • 13. RE: Can Patrol use Web services to monitor systems?
                                  Sudhir Bhatnagar

                                  Hi Laurent,

                                  I will be using WBEM for remote hosts. I found the URL KM marginally useful, mainly due to the fact that I am new to the KMs. I wanted to get some reading material that gives me a good background of KMs.

                                  I am looking forward to the sample code.
                                  Thanks.


                                  Sudhir

                                  Dan, I would investigate the KM Wizrd.

                                  • 14. RE: Can Patrol use Web services to monitor systems?

                                    Hi,

                                    I'm still busy with tons of things and have difficulties to find time to rewrite my code. In the meanwhile, please take time to read the BMC PATROL User Guides, and the many articles you can download in the DevCon forums.

                                    Here is a document that gives you the requirements for sending remote WBEM/WMI requests.

                                    Best regards,

                                    Laurent

                                    1 2 Previous Next