Solved

Creating my own commands

  • 7 March 2022
  • 4 replies
  • 529 views

Badge +1

Hi guys, I used Centreon for a long time to monitor firewalls and servers, but it's been five years since I last used it and now I'm setting up an instance at home to monitor my media server. I still remember most of the things, but I used to create my own commands and generating graphs for anything I needed, but I can't remember the output pattern that allows Centreon to understand the exit code as well as the values to be used in the graphs.

I learned a lot from the old forum which we cant access anymore (access denied 401). I don't know why they did that, but anyway.

The things I remember are:

I have to use exit codes 1,2,3 and to plot graphs I need something like tag=$value;min,max, but I cant remember or find the correct syntax. Can someone help me with that?

Today I just want to `ls -1 | wc -l`, and generate a graph from the output of this command. As simple as that.

Thanks

icon

Best answer by itoussies 7 March 2022, 10:01

View original

4 replies

Userlevel 3
Badge +9

Hello @tijuco,

 

As a reminder, here are the Plugin exit codes and their associated states:

Exit Code Service Host
0 OK UP
1 WARNING DOWN/UNREACHABLE
2 CRITICAL DOWN/UNREACHABLE
3 UNKNOWN

DOWN/UNREACHABLE

 

The Plugin ouput need to have this format if you want to have performance graphs:

output-plugin | metric1=valueunit;warning_treshold;critical_treshold;minimum;maximum metric2=value...

 

Regards.

Badge +1

Just one more thing, I can just omit maximum e let the values determine the scale of the charts, right?

Userlevel 5
Badge +16

Hello @tijuco 

Yep, the max and min is more usefull for other things.
The scale of the charts is define directly in Centreon and by default it’s scale on the value :)

 

 

Badge +1

Thank you guys. Those are very useful information. I hope they consider migrating the database of the old forum to this one.

Best

Reply