Menu

OQL Query to find Virtual Machines without Application Solution

Marcel
2016-07-18
2018-03-27
  • Marcel

    Marcel - 2016-07-18

    Hi,

    Does anybody know if it's possible (and if so how) to make an oql query that lists all the Virtual Machines that are not linked to any Application Solution?
    Much appreciated!

     
  • Thiago Arcanjo

    Thiago Arcanjo - 2016-07-20

    Yes,
    To make it easier, create an audit rule as follows:

    • Audit Category
      • Definition Set:
        ~~~
        SELECT FunctionalCI WHERE finalclass LIKE 'VirtualMachine'
        ~~~
    • Audit Rule
      • Query to Run:
        ~~~
        SELECT FunctionalCI AS fci JOIN lnkApplicationSolutionToFunctionalCI AS cfci ON cfci.functionalci_id = fci.id WHERE (finalclass LIKE 'VirtualMachine')
        ~~~
      • Valid objects? true
     
    • Marcel

      Marcel - 2016-07-21

      Wow perfect!!
      Thx :)

       
  • kalil andolsi

    kalil andolsi - 2018-03-26

    hello everybody
    please i want to know if its possible to list all application solution grouped by rack and physical device an virtual machine like:

    RACK 1

                                 Physical dev 1
                                 ----------------------
                                                 virtual machine 1
                                                  -----------------------------
                                                  application solution 1
                                                  application solution 2
                                                    .
                                                  ------------------------------
                                                  virtual machine 2
                                                  -----------------------------
                                                  application solution 3
                                                  application solution 4
                                                  .
                                   -----------------------
                                 physical device 2
                                 -----------------------
                                 . application solution 5
                                 .
    

    RACK 2

    .
    .

    THAN YOU

     
  • Pierre Goiffon

    Pierre Goiffon - 2018-03-26

    Hello,

    What do you mean by grouped by ? Like a SQL query, a OQL query will give you a table...

    Do you want to generate a webpage to display CI hierarchy ? Give some details of your needs...

    To give also some elements : OQL does not implement ORDER BY. Ordering has to be done using the PHP API, so inside a custom module. See the DBObjectSet constructor, $aOrderBy argument.

     
  • kalil andolsi

    kalil andolsi - 2018-03-27

    Hello,
    thank you very much for your reply,
    So i simplify my problem : I want to have ,by SQL or OQL query, the list of all device depends on a rack which the id_rack is passed as parameter to this request

    for example:
    select ... from ... where .... rack_id= : rack_id
    the result is all equipments which depends on this rack : all servers, all chassis, all storage devices , all VM, dbsever, webserver , webapplication, application solution....

    like the functionality "depends on" in itop, when I select an application solution --> other actions --> depends on, which list all dependence from this application to device ,

    i want to do the same thing but on the Opposite sense so when I select a rack I have all dependence from this rack to application solution

     

    Last edit: kalil andolsi 2018-03-27
  • Vincent @ Combodo

    Search on which class rack_id is defined.
    If it's on a unique class, that's what you need to select, if it is defined on multiple classes, then use UNION.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.