2

Okay so i am completely new to Landscape but i am starting to love it!

I want to create a graph that runs the following command:

netstat -an | grep -c 8105

Which will return a number of how many is connected to my servers socket!

So i pressed new graph:

enter image description here

Sadly as you can see from the picture i get the script needs interpeter

I am not sure what that means or how i get it to execute my command.

So i was hoping someone here could help me out and have tried it before?

1 Answer 1

4

I believe it's asking you for a #!/bin/bash to tell it to run a bash script.

In the terminal, you are already running bash. When you run a command in a terminal it runs a bash command. To run bash commands as a script, you usually include a header that specifies the interpreter.

Use this instead:

#!/bin/bash
netstat -an | grep -c 8105

If that doesn't work, use this instead:

/bin/bash -c netstat -an | grep -c 8105

en.wikipedia.org/wiki/Shebang

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .