Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

sql query to get list of PCs (deployment)

Hi,

how I can get the list of PCs to which OCS has deployed a package?

I would like to do this via sql query and not via web interface (Deployment -> Activate -> etc.).

In which tables are this information contained?

Thank you very much

Matteo

in Package deployment by (140 points)

1 Answer

0 votes

try this, it is not exactly what you need, but with i am sure thatt you can alter this query to your needs

SELECT a.name, d.tvalue,d.ivalue,d.comments,e.fileid, e.pack_loc,h.name as name_server,h.id,a.comment FROM devices d left join download_enable e on e.id=d.ivalue LEFT JOIN download_available a ON e.fileid=a.fileid LEFT JOIN hardware h on h.id=e.server_id WHERE d.name='DOWNLOAD' and a.name != '' and pack_loc != '' AND d.hardware_id=18839 union SELECT 'REMOVED PACKAGE', d.tvalue,d.ivalue,d.comments,e.fileid, 'REMOVED PACKAGE',h.name,h.id,a.comment FROM devices d left join download_enable e on e.id=d.ivalue LEFT JOIN download_available a ON e.fileid=a.fileid LEFT JOIN hardware h on h.id=e.server_id WHERE d.name='DOWNLOAD' and a.name is null and pack_loc is null AND d.hardware_id=18839

you must change the hardware id to to a existing one in your database query

by (24.4k points)
edited by
 
Powered by Question2Answer
...