VMware Cloud Community
Franck999
Enthusiast
Enthusiast
Jump to solution

Using script to collect Data

Hi,

I would like to use the new script feature to collect a metric.

I see that the script should return a value like key:value

This is my script :

#!/bin/bash

val=$(netstat -ntaupe |grep httpd | grep ESTABLISHED | wc -l)

echo "res=$val"

The script return some result like :

res=18

But the return result value metric in my script object is always 0

I see that script is executed , but tha's all.

Something I have missed here ?

Thans

1 Solution

Accepted Solutions
Franck999
Enthusiast
Enthusiast
Jump to solution

Got an answer, it's only because netstat need to be root and scripts are executes as epops user.

That's all Smiley Happy

View solution in original post

1 Reply
Franck999
Enthusiast
Enthusiast
Jump to solution

Got an answer, it's only because netstat need to be root and scripts are executes as epops user.

That's all Smiley Happy