|
|
| Author |
Message |
niobe Cacti User
Joined: 10 Mar 2008 Posts: 93 Location: Australia
|
Posted: Sun Mar 23, 2008 1:27 am Post subject: Bug with Data Input Methods? |
|
|
Hi,
I am creating a new data input method to solve the problem described here:
http://forums.cacti.net/viewtopic.php?p=130415
..and am running into a problem that looks like a bug to me. I am running Cacti 0.87b and PA2.0.
The basic idea to create a generalised method of returning static values to Cacti that you maintain in a file. See my other post for details why I am doing this .
This file is in basic "key value" form, e.g. say I have a file like this:
| Code: |
huxacs1 115
huxac1 41
mnzac1 13
hanac1 18
copac1 27
csitac1 1
chanac1 10
msoac1 5
|
The "keys" are the hostnames and the "values" are the numbers.
So my input method allows me to get a "keyed value" by giving it the path to the file and the key I want to look up.
The script is very simple:
| Code: |
[niobe@server scripts]$ cat get_key_value.sh
HOST=$1
FILE=$2
VALUE=`grep -w ${HOST} ${FILE} | cut -d' ' -f 2`
echo $VALUE
|
Example of using this:
| Code: |
[niobe@server scripts]$ sh get_key_value.sh huxacs1 wap_counts.txt
115
|
So here is my method definition:
Now I need to create either a data template or a data source to use it. This is where the problem occurs using either way:
There is no information in the logs why this is occuring, and it seems very strange as the custom data field should take arbitrary text. After all it is just being passed to the script and Cacti does not need to interpret it.
My method is modelled off the included "Linux - Get Memory Usage" so it looks as though I have done everything right but I can't be sure..
Does anyone know if this unexpected behaviour or what's going on?
cheers,
Niobe |
|
| Back to top |
|
 |
niobe Cacti User
Joined: 10 Mar 2008 Posts: 93 Location: Australia
|
Posted: Mon Mar 24, 2008 7:08 pm Post subject: |
|
|
| bit of bump ... I need some confirmation before logging a bug so would be grateful for any responses from people who have made input methods before... |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 11294 Location: Muenster, Germany
|
Posted: Wed Mar 26, 2008 3:45 pm Post subject: |
|
|
Tried to exactly copy your problem to no avail.
This is done on latest SVN of 087 branch, so your code surely will differ. Then I tried on cacti087b plugin code, again everything was fine.
If you exit at that failing step, is the Data Template saved? Only the two fields missing? If this is the case, please export the Data Template and post
And please note your cacti version
Reinhard |
|
| Back to top |
|
 |
niobe Cacti User
Joined: 10 Mar 2008 Posts: 93 Location: Australia
|
Posted: Thu Mar 27, 2008 5:25 pm Post subject: |
|
|
Very strange, I am on standard 0.87b with PA2.0, discover, aggregate & weathermap plugins installed.
I will try to reproduce it on a duplicate system. |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 11294 Location: Muenster, Germany
|
Posted: Fri Mar 28, 2008 3:36 pm Post subject: |
|
|
Please try to reproduce on a plain vanilla cacti before installing plugins as a first step.
From theory, I would bet that those plugins you named will NOT cause this kind of mayhem
Reinhard
Last edited by gandalf on Sun Mar 30, 2008 7:02 pm; edited 2 times in total |
|
| Back to top |
|
 |
niobe Cacti User
Joined: 10 Mar 2008 Posts: 93 Location: Australia
|
Posted: Fri Mar 28, 2008 11:55 pm Post subject: |
|
|
I had to change one function in one file to get PA to work, apart from that the only major thing I have messed with is file permissions - will do as you suggest and try a vanilla install.
cheers, |
|
| Back to top |
|
 |
|