How to Format check_disk plugin output?

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
iam33
Posts: 58
Joined: Mon Mar 18, 2013 5:30 am

How to Format check_disk plugin output?

Post by iam33 »

Hi!

I´m newbie in "this world", so I apologize if I'm asking obvious things.

I´m configuring check_disk to monitoring disk status in Nagios, and all is well. But the screen status of any machine monitored by check_disk, shows a large amount of data that I don´t need.

Is there any way to configure the output of "Status Information" to show what I need?

Thanks in advance!!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: How to Format check_disk plugin output?

Post by slansing »

Can you show us an example of what you are trying to get removed? I do not believe this is possible as Nagios reads plugin output in as plain text, and the status metrics transfer with it as well, it would have to be changed within the plugin script.
iam33
Posts: 58
Joined: Mon Mar 18, 2013 5:30 am

Re: How to Format check_disk plugin output?

Post by iam33 »

I have tried a lot ways but I could not get it....
I´m going try to explain that I would like:
With this:

Code: Select all

check_disk -w 20% -c 10%

I´m obtaining:

Code: Select all

DISK OK - free space: / 91105 MB (74% inode=98%): /boot 79 MB (84% inode=99%): /dev/shm 4057 MB (100% inode=99%): /software/version 91105 MB (74% inode=98%): 	
And, I want obtain this:

Code: Select all

DISK OK - free space: 
	/ 91105 MB (74%) 
	/boot 79 MB (84%) 
	/dev/shm 4057 MB (100%) 
	/software/version 91105 MB (74%)
Is there any way to do that?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How to Format check_disk plugin output?

Post by abrist »

iam33 wrote: Is there any way to do that?
Most likely. but you will need to change the plugin source/script. Are you collecting performance data in your check? By separating each line like you want, you may break performance data output.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
iam33
Posts: 58
Joined: Mon Mar 18, 2013 5:30 am

Re: How to Format check_disk plugin output?

Post by iam33 »

thank you so much!!
But could you send me an example of this change in the plugin source?
I do not understand what you mean when you say:

Code: Select all

Are you collecting performance data in your check?
Could you explain me, please?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How to Format check_disk plugin output?

Post by abrist »

iam33 wrote:thank you so much!!
But could you send me an example of this change in the plugin source?
The "check_disk" plugin is a C program, so you would need to change the source and recompile it. The printf statements in the source are a bit tricky, so if you do not understand C, you may want to look at a different plugin or deal with the current output.
I do not understand what you mean when you say:
Are you collecting performance data in your check?
Could you explain me, please?
Usually, plugins will report performance data to nagios by adding "|" (pipe) to the end of the output. Everything after the pipe is considered performance data. Take a look at the the following document for an explanation of the expected plugin format:
http://nagiosplug.sourceforge.net/devel ... lines.html
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked