Solved

how to pass argument into cacti input field

Posted on 2009-07-08
18
1,043 Views
Last Modified: 2012-08-14
HI,
i am following this article :
http://forums.cacti.net/about30124.html&highlight=
so i add the script :
#!/bin/bash

CURL=/usr/bin/curl
$CURL -m 60 -w "total:%{time_total} dns:%{time_namelookup} connect:%{time_connect} pretransfer:\
%{time_pretransfer} starttransfer:%{time_starttransfer}" -o /dev/null -s $1

NOw, as this article said,
" So the complete Input string is: /home/cactiuser/measure.sh <url> "

so i put this way : /root/measure <www.domain.com>
but when i am clicking on ADD button its saying

Error: This script appears to have no input values, therefore there is nothing to add.

so, what i am missing ?? what does it mean,?? what do i need to modify the scrept ??

i saw another article :http://forums.cacti.net/about24594.html&highlight=
but i am not clear, what it mean by "adding something like <host> <arg1> etc ?

can any one please help me to understand ??
0
Comment
Question by:fosiul01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 12
  • 6
18 Comments
 
LVL 1

Expert Comment

by:Lab42
ID: 24803866
I suppose you should add the argument to the script without < >
NOT /root/measure <www.domain.com>
BUT /root/measure www.domain.com
Also, in order to avoid possbile permissions problems, you better place the script a a directory executable by normal users, something like :
/usr/local/bin/measure
and make it executable:
chmod 755 /usr/local/bin/measure
0
 
LVL 29

Author Comment

by:fosiul01
ID: 24803966
i can conferm you, this script is exectuable, and its not a permission issue ..

Ok i run this script like this in the Shell,

/root/measure www.domain.com

its run, which is execting this script from Shell.

but As far i belvied, cacti will have execute this script ,
so,  if you follow the article i gave, you need to add the script with argument in the cacti

but problem is, its saying the above error
0
 
LVL 1

Expert Comment

by:Lab42
ID: 24804528
Ok, sorry, I replied without a live check.
I tried the procedure on a fresh installation.

Where it says:
So the complete Input string is: /home/cactiuser/measure.sh <url>
you have to write that without replacing <url> with your example site (that will be defined later)

so leave the input string in the creation of the Data Input Method something like
 /root/measure <url>
( /root/measure must be excutable by cactiuser so maybe it still better to place it somewhere else)

then go on following the article.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 29

Author Comment

by:fosiul01
ID: 24804747
Ok have a look to this picture

accroding to the articled :

1.Gave the Data Input a name of "Apache Curl Query"
2.Changed the Input Type to: "Script/Command"
3.Gave the Input String a complete path to the script of: "/home/cactiuser/measure.sh" followd by <url>
4.So the complete Input string is: /home/cactiuser/measure.sh <url>

5.-Also made sure the script was owned my cactiuser and made sure it was executable.

6.Next I identified 1 Input field and gave it a name of "url" with all defaults.

i have problem with Number 6 line

i am clikign on ADD button, its giving that error

am i doing anything wrong ??
cacti.GIF
0
 
LVL 1

Accepted Solution

by:
Lab42 earned 500 total points
ID: 24804921
I see
/root/testmeasure.sh <>
should be
/root/testmeasure.sh <url>
0
 
LVL 29

Author Comment

by:fosiul01
ID: 24804989
HI
you know what, i tryed this

/root/testmeasure.sh <url>

but it didnto work before, but now i tryed again, its took me to Input field section!!!!

but where the domain name will go ??!!!
have a look the second picture

normaly this script runs like this

./testmeasure.sh www.domina.com

so this domainname.com will go to input fields i guess, is not it ??
cacti1.GIF
0
 
LVL 29

Author Comment

by:fosiul01
ID: 24805072
ok ignore my previous post of inputfield

give me little bit of time, let me finish rest of the section, i will come back

i know, you have solved my problem, but just give me little bit of time,
0
 
LVL 29

Author Comment

by:fosiul01
ID: 24805350
Ok i guess i am having the same problem

graph is not commiing,

the author fixed it by doign this

it was indeed the default max value being zero. One I flipped it to 100 my graphs started showing.

but do you have any idea , where to set this value ??

i am in in cacti
0
 
LVL 1

Expert Comment

by:Lab42
ID: 24805463
Should be:
Maximum Value
The maximum value of data that is allowed to be collected.
in the Data Source Item module.
But actually even if set to 100 it doesn't graph also on my test install :-I
0
 
LVL 29

Author Comment

by:fosiul01
ID: 24805511
yap you are right ...

check in your

cacti/scripts/rra

directory if the rrd file has been created or not

i will be off for 1 hours
then i will check again

looks like we are gettign there
0
 
LVL 29

Author Comment

by:fosiul01
ID: 24807792
ok...
any  luck mate ??

i did some investigaion,

i know the rrd is gathering withi all data
i can create png file manually
but dont know why its not comming to graph
0
 
LVL 29

Author Comment

by:fosiul01
ID: 24807915
Ok i will close this question, as you gave my initiall answer, i will open another one, if you are upto that, try to give me a solution
0
 
LVL 1

Expert Comment

by:Lab42
ID: 24808416
I still have the same problem: data is gathered, rrds are created, but graphs are not shown.
I suspect that the values gathered are somehow "out of range":
                        <!-- 2009-07-08 22:05:00 CEST / 1247083500 --> <row><v> 1.7006666667e-02 </v></row>
                        <!-- 2009-07-08 22:10:00 CEST / 1247083800 --> <row><v> 1.7993333333e-02 </v></row>
..
but still haven't figured the solution :-I
0
 
LVL 29

Author Comment

by:fosiul01
ID: 24808431
i have create another question
http://www.experts-exchange.com/OS/Linux/Q_24554706.html?cid=295

keep on eye, see what other people say
0
 
LVL 29

Author Comment

by:fosiul01
ID: 24808638
one thing is wired
 rrdtool info localhost_connect_16.rrd

filename = "localhost_connect_16.rrd"
rrd_version = "0003"
step = 300
last_update = 1247088602
ds[connect].type = "GAUGE"
ds[connect].minimal_heartbeat = 600
ds[connect].min = 0.0000000000e+00
ds[connect].max = NaN
ds[connect].last_ds = "0.123"


ds[connect].max = NaN : why its NAN ??
0
 
LVL 29

Author Comment

by:fosiul01
ID: 24809011
Ok solved!!

Graphmanagement->Select the Graph->Edit graph item->select graph item type to Line1

it will show you the graph
0
 
LVL 1

Expert Comment

by:Lab42
ID: 24811411
Yeah, it works!
Thank you for letting me discover this new twist to cacti monitoring :-)
0
 
LVL 29

Author Comment

by:fosiul01
ID: 24811437
LOL

it took me 4 hours to find out it would be LINE
good luck with cacti
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question