CentOS 7.x Run custom query in iTop

From Notes_Wiki

Home > CentOS > CentOS 7.x > Web Based Tools > itop > CentOS 7.x Run custom query in iTop

To run custom query in itop use:

  1. First login as admin user
  2. Go to "Admin Tools" -> "Data Model", here you can see the table name in (). For example for Web Application table name is WebApplication.
  3. Clicking on the name will give details of various fields in the table
  4. Go to "Admin Tools" -> "Run Queries".
  5. You can run queries such as:
    SELECT PC AS pc, WHERE pc.end_of_warranty > NOW() AND pc.end_of_warranty < DATE_ADD(NOW(), INTERVAL 30 DAY)
    The above query searches for PCs whose warranty is expiring between today and next 30 days.
    Various other 'Query Examples' are given at top using link at same page. Note that SELECT, WHERE etc. should be in capital. Table names and field names are case sensitive.
  6. For useful queries you can go to "Admin Tools" -> "Query phrasebook" and then add this custom query. For adding choose appropriate name and description. Enter query as it is in Expression. In Fields type '*'. (Purpose/Usage of Fields in not clear yet).
  7. You can also directly connect to Mariadb backend database. For every object type there is a view_<table-name> view. For example for PC there is view_PC view. This can be queried using normal SQL syntax.


Home > CentOS > CentOS 7.x > Web Based Tools > itop > CentOS 7.x Run custom query in iTop