Fix/missing packages inventory solaris agent #5144
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR aims to add capabilities to the inventory dashboard to show information from Solaris OSs
Issues Resolved
#5079
Evidence
Testing
Information for the test
To test this PR is necessary to have a manager and register a Solaris agent.
Additionally, it is possible to mock the responses. Here are the expected responses from the endpoints, cloned from a server with actual Solaris agents:
Solaris 11
GET /api/syscollector/{agent id}
{"hardware":{"cpu":{"name":" "},"scan":{"id":0,"time":"2023-01-25T12:09:28+00:00"},"board_serial":" ","agent_id":"002"},"os":{"os":{"major":"11","minor":"4","name":"SunOS","platform":"sunos","version":"11.4"},"scan":{"id":0,"time":"2023-01-25T12:09:28+00:00"},"release":"5.11","version":"11.4.0.15.0","sysname":"SunOS","architecture":"i86pc","hostname":"solaris11","agent_id":"002"}}
GET /syscollector/{agent id}/processes
{"data":{"affected_items":[],"total_affected_items":0,"total_failed_items":0,"failed_items":[]},"message":"No syscollector information was returned","error":0}
GET /syscollector/{agent id}/ports
{"data":{"affected_items":[],"total_affected_items":0,"total_failed_items":0,"failed_items":[]},"message":"No syscollector information was returned","error":0}
GET /syscollector/{agent id}/packages
{"data":{"affected_items":[{"scan":{"id":0,"time":"2023-01-25T12:09:28+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Audio Drivers","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"audd","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:28+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Removable volume manager","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"rmvolmgr","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Core Solaris Network Infrastructure (Root)","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"cnetr","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Sun IB Hermon HCA driver","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"hermon","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"ntfsprogs - Utilities that provide access to NTFS","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"ntfsprogs","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Interprocess Communications","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"ipc","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"kernel RPCSEC_GSS","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"rsgk","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Core Architecture, (Kvm)","architecture":"i386.i86pc","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"kvm.i","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Time Slider ZFS snapshot management","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"gnome-time-slider-l10n","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:30+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Core Solaris Kernel (Root)","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"ckr","agent_id":"002"}],"total_affected_items":240,"total_failed_items":0,"failed_items":[]},"message":"All specified syscollector information was returned","error":0}
GET /syscollector/{agent id}/netaddr
{"data":{"affected_items":[{"scan":{"id":0},"address":"fe80::a00:27ff:feca:207a","netmask":"ffc0::","iface":"net0","proto":"ipv6","agent_id":"002"},{"scan":{"id":0},"address":"192.168.0.217","netmask":"255.255.255.0","iface":"net0","broadcast":"192.168.0.255","proto":"ipv4","agent_id":"002"}],"total_affected_items":2,"total_failed_items":0,"failed_items":[]},"message":"All specified syscollector information was returned","error":0}
GET /syscollector/{agent id}/netiface
{"data":{"affected_items":[{"rx":{"bytes":5072,"dropped":0,"errors":0,"packets":45},"scan":{"id":0,"time":"2023-01-25T12:09:28+00:00"},"tx":{"bytes":5256,"dropped":0,"errors":0,"packets":42},"name":"net0","mac":"08:00:27:CA:20:7A","mtu":1500,"state":"up","type":"Ethernet","agent_id":"002"}],"total_affected_items":1,"total_failed_items":0,"failed_items":[]},"message":"All specified syscollector information was returned","error":0}
Solaris 10
GET /api/syscollector/{agent id}
{"hardware":{"cpu":{"name":" "},"scan":{"id":0,"time":"2023-01-25T12:13:08+00:00"},"board_serial":" ","agent_id":"003"},"os":{"os":{"major":"10","name":"SunOS","platform":"sunos","version":"10"},"scan":{"id":0,"time":"2023-01-25T12:13:08+00:00"},"release":"5.10","version":"Generic_147148-26","sysname":"SunOS","architecture":"i86pc","hostname":"unknown","agent_id":"003"}}
GET /syscollector/{agent id}/processes
{"data":{"affected_items":[],"total_affected_items":0,"total_failed_items":0,"failed_items":[]},"message":"No syscollector information was returned","error":0}
GET /syscollector/{agent id}/processes
{"data":{"affected_items":[],"total_affected_items":0,"total_failed_items":0,"failed_items":[]},"message":"No syscollector information was returned","error":0}
GET /syscollector/{agent id}/ports
{"data":{"affected_items":[],"total_affected_items":0,"total_failed_items":0,"failed_items":[]},"message":"No syscollector information was returned","error":0}
GET /syscollector/{agent id}/packages
{"data":{"affected_items":[{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"11.9.0","format":"pkg","description":"Symbios 895A, 896 and 1010 SCSI driver","architecture":"i386","vendor":"LSI Logic Corporation","install_time":"2023-01-19T12:26:00+00:00","name":"hisl","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"1.6.0","format":"pkg","description":"JDK 6.0 64-bit Dev. Tools (1.6.0_37)","architecture":"i386","vendor":"Sun Microsystems, Inc.","install_time":"2023-01-19T12:27:00+00:00","name":"j6dvx","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"6.6.2.4099","format":"pkg","description":"Pixman library","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:24:00+00:00","name":"pixman","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"11.10.0","format":"pkg","description":"LLC2 driver and its initialization programs","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:28:00+00:00","name":"llc","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"11.10.0","format":"pkg","description":"Intel 1Gb PCI Express NIC PF and VF Driver","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:27:00+00:00","name":"igb","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"GNOME2,application,JDS3","source":" ","size":0,"version":"20.2.6.0","format":"pkg","description":"libtiff - library for reading and writing TIFF - developer files","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:27:00+00:00","name":"Tiff-devel","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"GNOME2,application,JDS3","source":" ","size":0,"version":"2.6.0","format":"pkg","description":"Accessibility Implementation for GNOME - developer files, platform dependent, /usr","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:28:00+00:00","name":"gnome-a11y-libs-devel","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"11.10.0","format":"pkg","description":"Sun IP over InfiniBand","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:23:00+00:00","name":"ipoib","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"11.10.0","format":"pkg","description":"3COM EtherLink III PCMCIA Ethernet Driver","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:27:00+00:00","name":"pcelx","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:10+00:00"},"section":"GNOME2,application,JDS3","source":" ","size":0,"version":"3.7.6.3","format":"pkg","description":"SQL database engine library","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:25:00+00:00","name":"sqlite3","agent_id":"003"}],"total_affected_items":1126,"total_failed_items":0,"failed_items":[]},"message":"All specified syscollector information was returned","error":0}
GET /syscollector/{agent id}/netaddr
{"data":{"affected_items":[{"scan":{"id":0},"address":"192.168.0.120","netmask":"255.255.255.0","iface":"e1000g0","broadcast":"192.168.0.255","proto":"ipv4","agent_id":"003"},{"scan":{"id":0},"address":"fe80::a00:27ff:fead:f945","netmask":"ffc0::","iface":"e1000g0","proto":"ipv6","agent_id":"003"}],"total_affected_items":2,"total_failed_items":0,"failed_items":[]},"message":"All specified syscollector information was returned","error":0}
GET /syscollector/{agent id}/netiface
{"data":{"affected_items":[{"rx":{"bytes":16065,"dropped":0,"errors":0,"packets":180},"scan":{"id":0,"time":"2023-01-25T12:13:08+00:00"},"tx":{"bytes":3740,"dropped":0,"errors":0,"packets":42},"name":"e1000g0","mac":"08:00:27:AD:F9:45","mtu":1500,"state":"up","agent_id":"003"}],"total_affected_items":1,"total_failed_items":0,"failed_items":[]},"message":"All specified syscollector information was returned","error":0}
Additional information:
The
ports
andprocesses
modules are not currently supported in Solaris agents, is expected that that information will not be shown.Test
Scenario: have a manager with a Solaris 10 agent registered, and syscheck enabled with all the modules and navigate to the agent tab
When the user navigates to the
Inventory data
sectionThen it should display information from the system and the packages table should be visible.
Scenario: have a manager with a Solaris 11 agent registered, and syscheck enabled with all the modules and navigate to the agent tab
When the user navigates to the
Inventory data
sectionThen it should display information from the system and the packages table should be visible.
Check List
yarn test:jest