From c2893d577b8903d9cffeaaa7bb6f02803c5ea199 Mon Sep 17 00:00:00 2001 From: Michael Erdely Date: Sat, 11 Jan 2025 14:02:23 -0500 Subject: [PATCH] Improvements for version.sh --- VERSION | 4 +- app.manifest | 2 +- bin/version.sh | 37 ++++- default/app.conf | 4 +- docs/ReleaseNotes.md | 10 ++ splunkbase.manifest | 361 ------------------------------------------- 6 files changed, 47 insertions(+), 371 deletions(-) delete mode 100644 splunkbase.manifest diff --git a/VERSION b/VERSION index 1d43a4b..9f50d06 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -9.2.0.1 -9.2.0.1 +9.2.0.2 +9.2.0.2 diff --git a/app.manifest b/app.manifest index 184ab32..da16fa8 100644 --- a/app.manifest +++ b/app.manifest @@ -29,7 +29,7 @@ "id": { "group": null, "name": "TA-nix", - "version": "9.2.0.1" + "version": "9.2.0.2" }, "license": { "name": "Splunk Software License Agreement", diff --git a/bin/version.sh b/bin/version.sh index ed494ef..7edd86f 100755 --- a/bin/version.sh +++ b/bin/version.sh @@ -5,10 +5,31 @@ # shellcheck disable=SC1091 . "$(dirname "$0")"/common.sh -PRINTF='END {printf "%s %s %s %s %s %s\n", DATE, MACH_HW_NAME, MACH_ARCH_NAME, OS_REL, OS_NAME, OS_VER}' +PRINTF='END {printf "%s %s %s %s %s %s %s %s %s\n", DATE, MACH_HW_NAME, MACH_ARCH_NAME, KERN_REL, OS_NAME, KERN_VER, OS_REL, OS_VER, DISTRO}' -if [ "$KERNEL" = "Linux" ] || [ "$KERNEL" = "SunOS" ] || [ "$KERNEL" = "Darwin" ] || [ "$KERNEL" = "FreeBSD" ] ; then +if [ "$KERNEL" = "Linux" ] ; then + assertHaveCommand date + assertHaveCommand uname + [ -f /etc/os-release ] && . /etc/os-release + machine_arch=$(uname -p) + os_release=$(uname -r) + os_version=$(uname -v) + [ -n "$NAME" ] && distro_name=$NAME + [ -n "$VERSION_ID" ] && os_release=$VERSION_ID + [ -n "$VERSION_ID" ] && os_version=$VERSION_ID + [ -r /etc/debian_version ] && grep -Eq "^[0-9.]+$" /etc/debian_version && os_release=$(cat /etc/debian_version) + [ "$BUILD_ID" = "rolling" ] && os_release=rolling + [ "$BUILD_ID" = "rolling" ] && os_version=rolling + + CMD="eval date ; eval uname -m ; eval uname -r ; eval uname -s ; eval uname -v ; echo $machine_arch; echo $os_release; echo $os_version; echo $distro_name" +elif [ "$KERNEL" = "Darwin" ] ; then + assertHaveCommand date + assertHaveCommand uname + assertHaveCommand sw_vers + os_release=$(sw_vers --productVersion) + CMD="eval date ; eval uname -m ; eval uname -r ; eval uname -s ; eval uname -v ; eval uname -p; echo $os_release; echo $os_release" +elif [ "$KERNEL" = "SunOS" ] [ "$KERNEL" = "FreeBSD" ] ; then assertHaveCommand date assertHaveCommand uname CMD='eval date ; eval uname -m ; eval uname -r ; eval uname -s ; eval uname -v ; eval uname -p' @@ -30,15 +51,21 @@ PARSE_0='NR==1 {DATE=$0}' # shellcheck disable=SC2016 PARSE_1='NR==2 {MACH_HW_NAME="machine_hardware_name=\"" $0 "\""}' # shellcheck disable=SC2016 -PARSE_2='NR==3 {OS_REL="os_release=\"" $0 "\""}' +PARSE_2='NR==3 {OS_REL="os_release=\"" $0 "\"";KERN_REL="kernel_release=\"" $0 "\""}' # shellcheck disable=SC2016 PARSE_3='NR==4 {OS_NAME="os_name=\"" $0 "\""}' # shellcheck disable=SC2016 -PARSE_4='NR==5 {OS_VER="os_version=\"" $0 "\""}' +PARSE_4='NR==5 {OS_VER="os_version=\"" $0 "\"";KERN_VER="kernel_version=\"" $0 "\""}' # shellcheck disable=SC2016 PARSE_5='NR==6 {MACH_ARCH_NAME="machine_architecture_name=\"" $0 "\""}' +# shellcheck disable=SC2016 +PARSE_6='NR==7 {OS_REL="os_release=\"" $0 "\""}' +# shellcheck disable=SC2016 +PARSE_7='NR==8 {OS_VER="os_version=\"" $0 "\""}' +# shellcheck disable=SC2016 +PARSE_8='NR==9 {DISTRO="distro_name=\"" $0 "\""}' -MASSAGE="$PARSE_0 $PARSE_1 $PARSE_2 $PARSE_3 $PARSE_4 $PARSE_5" +MASSAGE="$PARSE_0 $PARSE_1 $PARSE_2 $PARSE_3 $PARSE_4 $PARSE_5 $PARSE_6 $PARSE_7 $PARSE_8" $CMD | tee "$TEE_DEST" | $AWK "$MASSAGE $PRINTF" echo "Cmd = [$CMD]; | $AWK '$MASSAGE $PRINTF'" >> "$TEE_DEST" diff --git a/default/app.conf b/default/app.conf index 5d81fbe..ed1bf0e 100644 --- a/default/app.conf +++ b/default/app.conf @@ -17,7 +17,7 @@ docs_section_override = AddOns:released [launcher] author = Michael Erdely -version = 9.2.0.1 +version = 9.2.0.2 description = Technical Add-on for Unix and Linux #[package] @@ -26,5 +26,5 @@ description = Technical Add-on for Unix and Linux [id] name = TA-unix -version = 9.2.0.1 +version = 9.2.0.2 diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index a28658b..9bb7cde 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -1,5 +1,15 @@ # Technical Add-on for Unix and Linux +## Version 9.2.0.2 + +Improvements for version.sh + +Changes: + +* Include kernel_release, kernel_version, and distro_name +* For Linux and MacOS, use actual OS versions/releases instead of + kernel version/release + ## Version 9.2.0.1 Initial fork of the Splunk Add-on for Unix and Linux diff --git a/splunkbase.manifest b/splunkbase.manifest deleted file mode 100644 index 7099cc4..0000000 --- a/splunkbase.manifest +++ /dev/null @@ -1,361 +0,0 @@ -{ - "version": "1.0", - "date": "2024-10-18T12:52:23.073000921Z", - "date": "2025-01-08T18:38:19.132050611Z", - "hashAlgorithm": "SHA-256", - "app": { - "id": 833, - "version": "9.2.0.1", - "files": [ - { - "path": "LICENSES/Apache-2.0.txt", - "hash": "d3910dee6fe9fe134856d76268fe82adb1ade1ecf51b3568b7da6b94894b88f3" - }, - { - "path": "LICENSES/LicenseRef-Splunk-8-2021.txt", - "hash": "37906d637abbbeca35cfb2efcb658cabbc0208d101848372c1e55fbf9ba62e47" - }, - { - "path": "README/restmap.conf.spec", - "hash": "5cc8f9508cd792137e1a2129763dd78e9275a0c2f8d3cf7fc25b72848a07d869" - }, - { - "path": "README.txt", - "hash": "106e6203d3ff66f04cac953385cb517cff459b572f8d52adf71a8a59c5851776" - }, - { - "path": "THIRDPARTY", - "hash": "6340a3cf0959b37d83e10ce4e12bc4ab53d2ae2729ee506451b8d554418d1ab3" - }, - { - "path": "VERSION", - "hash": "fd47b230df0f247b21e965b9529efd00447fdbf1cb1740848b529f79a9feacac" - }, - { - "path": "app.manifest", - "hash": "251b481753129caea80da188d33f2b99bbd178560e136ee2936b4e9499e1416e" - }, - { - "path": "appserver/static/appIcon.png", - "hash": "6cb62d7fd2d90e69d66c3e4fbede9692f9d650176a7a9ec06edd4026f1de580a" - }, - { - "path": "appserver/static/components/js_sdk_extensions/common.js", - "hash": "295fe307ec286b9b4eb89c4b59dbd6204376e63b7346c26fd1b087446db372c2" - }, - { - "path": "appserver/static/components/js_sdk_extensions/monitor_inputs.js", - "hash": "27af704acaeb3b98c78ad5322a6171e1b748b5650be809f5d92a4e5618529123" - }, - { - "path": "appserver/static/components/js_sdk_extensions/scripted_inputs.js", - "hash": "6fe5d6f31a60a86d9988170e1641f13eb315351f890c2247c6de83b3aa372e26" - }, - { - "path": "appserver/static/setup.css", - "hash": "f27882e6a07bbd87f99f95d77211439e71959efae6d52ce4771ce26d06e0bcc9" - }, - { - "path": "appserver/static/setup.js", - "hash": "a3d4e2567779b605a97daa3ced2fc49a8e487a5ec4ee95080392824eb74e7e11" - }, - { - "path": "appserver/static/setup_cloud.js", - "hash": "00875c907fd0dc80fa5d05130c28410a8abd99a0ff43da86c6af87e01d8a21da" - }, - { - "path": "bin/bandwidth.sh", - "hash": "14682eacdc5ab8849ce3e786c05d0140ea166b6f28403106e433048c09533146" - }, - { - "path": "bin/common.sh", - "hash": "6569707362169122ec6a41c9345ed00e09e0913e3855ccb68a21ade3c1c9012d" - }, - { - "path": "bin/cpu.sh", - "hash": "e34d912324ceb3f6add524722adc9057b4177015fad844a5e37634ef40cbb9c7" - }, - { - "path": "bin/cpu_metric.sh", - "hash": "c5e937d91afab8ec06376a0db3c79f37e0da6377ea2b34cfde67793d89fd14d5" - }, - { - "path": "bin/df.sh", - "hash": "15c4e33987209afe1cb807af7aecfbd522107746d318827d161d1ee233d00acf" - }, - { - "path": "bin/df_metric.sh", - "hash": "286830c6b30cc9a3e5240e3b63db0edd2c68c9e797d452483dea09b4ad6f48e9" - }, - { - "path": "bin/hardware.sh", - "hash": "7722f446226609784d219cb525eee3ed65d622ce05122301f65625c6fd2e4434" - }, - { - "path": "bin/interfaces.sh", - "hash": "ebdd6823f6db05bc76ebdbfb61d1fda63959fd334cf59d2e038ea7bae64355b7" - }, - { - "path": "bin/interfaces_metric.sh", - "hash": "374e24c7e87669fbd25ded5e56c05fd057c0c272e03e0df6cabcd5db31267db9" - }, - { - "path": "bin/iostat.sh", - "hash": "505a4694c4879fd8ed155394be51431c9839fc9f980077abb0416f844f09d722" - }, - { - "path": "bin/iostat_metric.sh", - "hash": "59b775cc60e92950605b621989ee17aa947adc07d407c78b657ecedf90452f77" - }, - { - "path": "bin/lastlog.sh", - "hash": "8d8c0744767d9426cb98122d33eb6acd5447db4a03cfccfd5fdc014f1e15ea3e" - }, - { - "path": "bin/lsof.sh", - "hash": "a98a9c64496a081c395e00b692f5eca25ae186cc050c0f31d5425a561fdc63a1" - }, - { - "path": "bin/netstat.sh", - "hash": "a5ef9833cf21c6572431f32991d153a625510a4b0553fe6f56d07bb4f4914b2e" - }, - { - "path": "bin/nfsiostat.sh", - "hash": "eccc2bf3701840173206ecf7603c20861b4ce106b6be795df2fa312744958107" - }, - { - "path": "bin/openPorts.sh", - "hash": "9f7cb2a7f9e8b43ceb7e22930ea125855e64527caa13d76b5c219ec473b899c5" - }, - { - "path": "bin/openPortsEnhanced.sh", - "hash": "d7e19798aec7fb3244b6fe36fce28ca3fc8951a0e38d0516f5ef8c1b06197246" - }, - { - "path": "bin/package.sh", - "hash": "d9da2664cc2b913285d595e7c74dab9e5a6f1703d44e8f517e9b62a5ba70496a" - }, - { - "path": "bin/passwd.sh", - "hash": "4ab37e3c9d07842777ed42f8b22adfe8fe05a9ab0758e833fdc885a26237bafe" - }, - { - "path": "bin/protocol.sh", - "hash": "61e372f670cb74131890a2c0ff381891c83337687b6809f31bf920a99f5bd432" - }, - { - "path": "bin/ps.sh", - "hash": "3a6ebc99c1b5207d54c885338cf06b22f343c1f64a6048d03fd0bf48b82d41b5" - }, - { - "path": "bin/ps_metric.sh", - "hash": "ff65aec6a98560667d08e1b75f4661d99b5255be239756f89cc72a58d1e44fe2" - }, - { - "path": "bin/rlog.sh", - "hash": "96d0cc8f2c0beec46bca37d7ddf73c122f76525b7363d9a2fec92125abab83a2" - }, - { - "path": "bin/selinuxChecker.sh", - "hash": "409ad1927603069c7b08e09e60f2edf1c7e50f02eb6a64c7a514693131dc82e6" - }, - { - "path": "bin/service.sh", - "hash": "d579051391bd1af365bdda6016e3529009e0e7b62e1846fdcdb755b36f0d7c49" - }, - { - "path": "bin/setup.sh", - "hash": "b0263d112fa183411bfe141840d697217025856d44fa67be6d14b240728b7062" - }, - { - "path": "bin/setupservice.py", - "hash": "c69d1b0b4a10ec966c2e752b7ec1c3f4be5ca3721626bbab62ddfe1509d15137" - }, - { - "path": "bin/sshdChecker.sh", - "hash": "ba9ada21b413a1f7ea5ab7850314e96b03c8a3369267af24d9cf2d8f76edb6dc" - }, - { - "path": "bin/time.sh", - "hash": "5ad0ed71a9c4637046da43656aea4a614e331217fb707e9df7443aaa6036eeba" - }, - { - "path": "bin/top.sh", - "hash": "f380506de00a3bb51d9351108057e498cd8211e3ade7c16fa65121d3ff66ba1d" - }, - { - "path": "bin/update.sh", - "hash": "2cce5510b8cf94e3c32681c934985a01164e2b63b64d458de9a7dc0ff81bc679" - }, - { - "path": "bin/uptime.sh", - "hash": "2770952e0c29a92e37d2d23a8a93223812e2facd4597c50e3e832439fdbdf600" - }, - { - "path": "bin/usersWithLoginPrivs.sh", - "hash": "0006baa9bc57e6b5711e557b6532b8c48b29d42bca6364d664042d2aa6f2cf12" - }, - { - "path": "bin/version.sh", - "hash": "4d484fc3e1853d0e07d47ba9c4401266a1fbe0712a554e9eeaeb835b96d8a59f" - }, - { - "path": "bin/vmstat.sh", - "hash": "9ce5a407629d5d47c2c3f8b1d046f712d24a232950c54d450ddbc21bd34aea84" - }, - { - "path": "bin/vmstat_metric.sh", - "hash": "85c516f1d73b9cb45e3b16819fada786753fa417f2fbded1955ccace62de41f8" - }, - { - "path": "bin/vsftpdChecker.sh", - "hash": "0009c03f72289e5b7b692cb74951382d1a6d4c3698ef5b08b74e468f3dfe199f" - }, - { - "path": "bin/who.sh", - "hash": "47318dee6246abfd577984383ac134225a84e0dcf0753413f88b7f2be5a8087d" - }, - { - "path": "default/app.conf", - "hash": "e5c48e804d836b03361fea96c1e78f265116f5117a739f4dad9bc1916ad873f8" - }, - { - "path": "default/data/ui/nav/default.xml", - "hash": "36078398f91fa377c21f2369271797cc0016b8ba1a6f271e327cce2809f2711d" - }, - { - "path": "default/data/ui/views/ta_nix_configuration.env_cloud.xml", - "hash": "7176b693e2eeb2757d6a5a9651e793141a52b5b36f4b229c31f4ab3e970e8510" - }, - { - "path": "default/data/ui/views/ta_nix_configuration.xml", - "hash": "2d30308510e08aea0a190984fda45b708ab373768796494202a4813c37ef74d2" - }, - { - "path": "default/eventtypes.conf", - "hash": "c52b63bf8b429e406a1488c59c1945531123bed647b08460d85ca3a6a4f8f81e" - }, - { - "path": "default/inputs.conf", - "hash": "0eff320f7aba6d35e27e8a0ae0837ad6c4340f9e84a9cdfb71e8162a97ecc782" - }, - { - "path": "default/macros.conf", - "hash": "0daf589bcfbd430f45b55ed3f3d0784f8ad6e79d75300fac9c2604a79fc7f4dc" - }, - { - "path": "default/props.conf", - "hash": "8742759e63baf3dc737adecec95fb7370741cb5f2268064593cb2e5a1ba8b260" - }, - { - "path": "default/restmap.conf", - "hash": "2774f5332efc8bfeebb88a1d771b8d65cca9197666d0c5e9a4a371b8ed468d73" - }, - { - "path": "default/tags.conf", - "hash": "ad29e489018a892f8d50731e32efa48a01dcdb438096d443f7b6e068cfd1ca15" - }, - { - "path": "default/transforms.conf", - "hash": "d13792dde1aa85d9e864782787948d6f10b888e4a689d6668de3cc604e2ad1ab" - }, - { - "path": "default/web.conf", - "hash": "75f12a6541d22c27d526ab544973398ae4b6d5aa1e57e8e4b22e845e564a2e56" - }, - { - "path": "lookups/nix_da_update_status.csv", - "hash": "a9a794b39377946e0dcb5f70c9c8ba6114fec1728512c9f39cfb0f3eca46159c" - }, - { - "path": "lookups/nix_da_version_ranges.csv", - "hash": "992529c548d8273e073a988d089fbd5c7fa5c1ef47d51243e9da9dfb77eba6d2" - }, - { - "path": "lookups/nix_linux_audit_action_object_category.csv", - "hash": "5838950fd3cade537dea91d1dcdcbd10532457fa7de07d397bfc699e56a19867" - }, - { - "path": "lookups/nix_linux_service_startmodes.csv", - "hash": "dd669b358909f4d9be9d0aef9f4720e78a290e422a90ec3e3cdabe39ed9b8be2" - }, - { - "path": "lookups/nix_vendor_actions.csv", - "hash": "f287b03905a705fed92dd4a1d1cf060c16b9521aba80b06494af8d5e8530fa97" - }, - { - "path": "metadata/default.meta", - "hash": "6fa3057938996152cdfeddb46b20a1c079966ba87a56cf7c13c9d35f3caaf2e7" - }, - { - "path": "static/appIcon.png", - "hash": "6cb62d7fd2d90e69d66c3e4fbede9692f9d650176a7a9ec06edd4026f1de580a" - }, - { - "path": "static/appIconAlt.png", - "hash": "6cb62d7fd2d90e69d66c3e4fbede9692f9d650176a7a9ec06edd4026f1de580a" - }, - { - "path": "static/appIconAlt_2x.png", - "hash": "d7ad6f1263583f5b280b52be4f8806b0d22a4aa6e328a0209212697b6734570c" - }, - { - "path": "static/appIconLg.png", - "hash": "d7ad6f1263583f5b280b52be4f8806b0d22a4aa6e328a0209212697b6734570c" - }, - { - "path": "static/appIconLg_2x.png", - "hash": "11ca7ef68587f5f1bacbbcb24b85924089724bcf02610b512f899fadac186f34" - }, - { - "path": "static/appIcon_2x.png", - "hash": "d7ad6f1263583f5b280b52be4f8806b0d22a4aa6e328a0209212697b6734570c" - } - ] - }, - "products": [ - { - "platform": "splunk", - "product": "enterprise", - "versions": [ - "9.0", - "9.1", - "9.2", - "9.3", - "9.4" - ], - "architectures": [ - "x86_64" - ], - "operatingSystems": [ - "windows", - "linux", - "macos", - "freebsd", - "solaris", - "aix" - ] - }, - { - "platform": "splunk", - "product": "cloud", - "versions": [ - "9.0", - "9.1", - "9.2", - "9.3" - ], - "architectures": [ - "x86_64" - ], - "operatingSystems": [ - "windows", - "linux", - "macos", - "freebsd", - "solaris", - "aix" - ] - } - ] -}