Can I run an analysis against fixlet exit codes

Hi,

I’ve created a Fixlet running a basic shell script to test connection to an internal network on Red Hat system with Exit codes.
0 - Connected
1 - Not connected

I want to include this information in a web report I am creating, how can I go about doing this? My thoughts are to run an analyses against the exit codes but how do I do that? or would you do it in another way?

1 Like

There are at least two different ways you can approach this:

  1. Via a custom Web Report, you can leverage the exit code of <bes action result> session relevance inspector to report on the exit codes for a given action, or set of actions against your endpoints

  2. In your Fixlet running a basic shell script, have it output the exit code to a file, create an analysis property to return the value within the file, and create a report against that property.

If you’d like some assistance with one of these approaches, or have additional questions, certainly let us know.

1 Like

Hi Aram,

This is the basic Shell script I am running via a fixlet, I want to drop the output into a webreport I am building what relevance would I use to gather that in an analysis?


#!/bin/sh
(yum repolist > /tmp/yum-repolist) > /dev/null 2>&1
repolist=grep repolist /tmp/yum-repolist | awk -F: '{print $NF}'| sed -e 's/ //g; s/,//g'
if [ $repolist -gt 0 ]; then
echo “CONNECTED” > /tmp/yum-repolist-result
exit 0
else
echo “FAILED” > /tmp/yum-repolist-result
exit 1
fi


got it,

Simple

line of file “/tmp/yum-repolist-result”

1 Like

sorry it took a while to get back to you Adam, but thankyou