Skip to main content
Solved

Creating my own commands

  • March 7, 2022
  • 4 replies
  • 995 views

tijuco
Forum|alt.badge.img+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

Best answer by itoussies

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.

4 replies

itoussies
Centreonian
Forum|alt.badge.img+11
  • Centreonian
  • Answer
  • March 7, 2022

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.


tijuco
Forum|alt.badge.img+1
  • Author
  • Steward *
  • March 7, 2022

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


Forum|alt.badge.img+16
  • Steward **
  • March 8, 2022

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 :)

 

 


tijuco
Forum|alt.badge.img+1
  • Author
  • Steward *
  • March 8, 2022

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

Best