My Plugins Compatible with Graphic

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
liberodark
Posts: 25
Joined: Tue Mar 19, 2019 8:56 am

My Plugins Compatible with Graphic

Post by liberodark »

Hi,

How to make my plugin compatible with graphic ?

That is shell see

Code: Select all

./check_cpu -w 70 -c 90
CPU OK - Used = 0.00% | Core 0 = 0.00%; Core 1 = 0.99%
But for me just work OK / Warning / Critical but Graph no work :(

Image

Need to see on graph not "Core 0" and "Core 1" but just "Used"
The problem is pipe "|" ?

some server even errors :

Image

Have other same plugin :

Code: Select all

./check_mem -w 70 -c 90
MEMORY Warning - Used = 82.64% | Total: 3756 MB Used: 3104 MB Free: 652 MB
But for this not have any informations on graphs :(

Best Regards
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: My Plugins Compatible with Graphic

Post by scottwilkerson »

The performace data need to be in a very specific format and you have some extra spaces in there.

See the performance data section here
https://nagios-plugins.org/doc/guidelines.html#AEN200

Specifically, if you plugin returned output like this it would succeed

Code: Select all

./check_cpu -w 70 -c 90
CPU OK - Used = 0.00% |'Core 0'=0.00%; 'Core 1'=0.99%;
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
liberodark
Posts: 25
Joined: Tue Mar 19, 2019 8:56 am

Re: My Plugins Compatible with Graphic

Post by liberodark »

Hi thanks and for

Code: Select all

./check_mem -w 70 -c 90
MEMORY Warning - Used = 82.64% | Total: 3756 MB Used: 3104 MB Free: 652 MB
Is

Code: Select all

./check_mem -w 70 -c 90
MEMORY Warning - Used = 82.64% | Total: '3756' MB Used: '3104' MB Free: '652' MB
?

Best Regards
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: My Plugins Compatible with Graphic

Post by cdienger »

Change:

Code: Select all

./check_mem -w 70 -c 90
MEMORY Warning - Used = 82.64% | Total: 3756 MB Used: 3104 MB Free: 652 MB

To:

Code: Select all

./check_mem -w 70 -c 90
MEMORY Warning - Used = 82.64% | 'Total'=3756MB 'Used'=3104MB 'Free'=652MB
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
liberodark
Posts: 25
Joined: Tue Mar 19, 2019 8:56 am

Re: My Plugins Compatible with Graphic

Post by liberodark »

Hi,

Thanks for reply have fix cpu and memory but memory is not work :

CPU work on all graph :

Code: Select all

check_cpu -w 70 -c 90
CPU OK - Used = 1.00% |'Core 0'=1.00%;
Memory not work on graph 1 but work on graph 2 :

Code: Select all

check_mem -w 70 -c 90
MEMORY OK - Used = 49.27% | 'Total'=1838MB 'Used'=906MB 'Free'=932MB
Graph 1 not work:
Image

Graph 2 work:
Image

You have any idea ?

If you need to see source this is a open source project :

check_cpu : https://github.com/liberodark/nrpe-inst ... heck_cpu.c
check_mem : https://github.com/liberodark/nrpe-inst ... heck_mem.c

Best Regards
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: My Plugins Compatible with Graphic

Post by scottwilkerson »

The Graph you are showing only has one datasource and your plugin is now returning 3, if the plugin changed after the rrd file was created you will need to delete the rrd and it should get re-created
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
liberodark
Posts: 25
Joined: Tue Mar 19, 2019 8:56 am

Re: My Plugins Compatible with Graphic

Post by liberodark »

Ok thanks im go to see that
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: My Plugins Compatible with Graphic

Post by scottwilkerson »

liberodark wrote:Ok thanks im go to see that
sounds good
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked