Need to make an analysis for Suse servers reporting

Hi All, I need to run the below mentioned commands in action and to call the output in a file and the call the out put in analysis to form a report which can tell me Suse server details:-1

dmidecode | grep Populated | grep -v disabled | wc -l - Check Socket count
a=cat /etc/SuSE-release ; echo $a - OS Version
dmidecode -t system | grep Product | awk -F: ‘{print $2}’ - Server Model
zypper lr | grep -i sap | wc -l - sap repos attached

Can anyone suggest to form an action script to run the commands in action to get an output in a file?

I am thinking like this below but not sure if it is going to work:-1:
if {name of operating system contains “Suse”}
do
dmidecode | grep Populated | grep -v disabled | wc -l >> /temp/file1
a=cat /etc/SuSE-release ; echo $a >> /temp/file2
dmidecode -t system | grep Product | awk -F: '{print $2}'v >> /temp/file3
zypper lr | grep -i sap | wc -l >> /temp/file4
endif

You can certainly execute scripts via actionscript, and parse the outputs as above. To do so, you can either download the script, or create it on the fly with something like:

delete __appendfile 
delete myscript.sh

createfile until EOF
	#!/bin/sh
	dmidecode | grep Populated | grep -v disabled | wc -l >> /temp/file1
	a=cat /etc/SuSE-release ; echo $a >> /temp/file2
	dmidecode -t system | grep Product | awk -F: '{{print $2}'v >> /temp/file3
	zypper lr | grep -i sap | wc -l >> /temp/file4
EOF

move __appendfile myscript.sh
wait chmod 555 myscript.sh
wait "{pathname of client folder of current site & "/myscript.sh"}"

That said, there are native relevance inspectors for most of the details you are looking to return, which would be easier, and much more efficient. Here are some potential examples:

// Number of CPU sockets
Q: count of cpupackage

// OS Version
Q: version of operating system

// Model
Q: manufacturer of system_information of dmi

3 Likes

Thank you:slight_smile: