I want to create a script to get information about cmdb_ci_spkg or cmdb_software_instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2024 10:09 PM
Hello everyone!
I have installed agent_client_collector and was able to get the linux data.
I am able to get software_installed in the tab agents - host - Related Links.
I would like to create a script to retrieve software_installed from cmdb_ci_server or cmdb_ci_linux_server or sn_agent_cmdb_ci_agent etc. to get the server's software information, but I don't know how to connect the above to cmdb_ci_spkg. spkg or cmdb_software_instance to the above, but I don't know how to connect the above to cmdb_ci_linux_server or sn_agent_cmdb_ci_agent to get the software.
I would appreciate it if you could tell me how to use Scripted REST APIs to get the software_installed tied to linux.
Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @shibayamayuta,
You’re on the right track. If I understood correctly, you want to fetch the software installed on a Linux server and expose it via Scripted REST API.
From what I’ve seen in the docs and community threads:
cmdb_ci_server / cmdb_ci_linux_server = the server itself
cmdb_software_instance = software instance records tied to that server
cmdb_ci_spkg = the package definition (roll-up), linked to the instances
They are usually connected through cmdb_rel_ci. So to get “software installed per server,” you’d query cmdb_software_instance filtered by the server, then expand to the package (cmdb_ci_spkg) if needed.
Most relevant references i found which can help:
How servers and software packages connect
https://www.servicenow.com/community/cmdb-forum/linking-cmdb-ci-server-and-cmdb-ci-spkg/m-p/2490179
https://www.servicenow.com/community/cmdb-forum/cmdb-ci-spkg-with-cmdb-ci-software-instance-or-anoth...
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.