[SOLVED]Data Input Methods with "home made" script

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
Burps
Posts: 2
Joined: Fri Mar 09, 2012 9:00 am

[SOLVED]Data Input Methods with "home made" script

Post by Burps »

Hi

I have made the following script :

Code: Select all

root@check-back5:~# /usr/lib/nagios/plugins_local/my_check.pl -H 1.2.3.4 -C my_comm -m 'Pattern1|Pattern2|Pattern3' -w 100 -c 50 -f
OK : (>100) - Pattern1: 167 left. Pattern2: 168 left. Pattern3: 131 left.  | 'Pattern1'=167 'Pattern2'=168 'Pattern3'=131

root@check-back5:~# /usr/lib/nagios/plugins_local/my_check.pl -H 1.2.3.4 -C my_comm -m 'Pattern1|Pattern2|Pattern3' -w 100 -c 50 
OK : (>100) - Pattern1: 167 left. Pattern2: 168 left. Pattern3: 131 left.
About the script : -w and -c are mandatory, but not used by cacti, and -f option is there to have the "perfdata" at the end (script was firstly designed for nagios).

I then followed this howto : http://docs.cacti.net/manual:087:3a_adv ... ut_methods, especially the end with "Script with more Output Parameters". I use the script without the "-f" option.

Problem is my graph is totally empty. I'm not sure if it takes my output correctly : does it deal the ":" fine ? what about the "left" in the output ?

How can I check that ?

Thanks in advance for your help

EDIT : I found this in cacti.log :

Code: Select all

03/09/2012 03:50:02 PM - SPINE: Poller[0] Host[2] ERROR: Empty result [1.2.3.4]: '/usr/lib/nagios/plugins_local/my_check.pl -H 1.2.3.4 -C my_comm -m Pattern1|Pattern2|Pattern3 -w 85 -c 90'
03/09/2012 03:50:02 PM - SPINE: Poller[0] Host[2] TH[4] DS[121] SCRIPT: /usr/lib/nagios/plugins_local/my_check.pl -H 1.2.3.4 -C  my_comm -m Pattern1|Pattern2|Pattern3 -w 85 -c 90, output: U
Last edited by Burps on Tue Mar 13, 2012 3:54 am, edited 1 time in total.
Burps
Posts: 2
Joined: Fri Mar 09, 2012 9:00 am

Re: Data Input Methods with "home made" script

Post by Burps »

OK Solved : I added an option to my script so that it only outputs :

Code: Select all

pattern1: 151 pattern2: 332 pattern3:542
as recommended here : http://www.cacti.net/downloads/docs/htm ... cacti.html

Now, it just works ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests