some questions about templates and data queries

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
soulshepard
Posts: 9
Joined: Fri Feb 09, 2007 8:20 am

some questions about templates and data queries

Post by soulshepard »

Dear community,

first of all i wish to thank the cacti team and community for this great product. i use it allready from the early stages of its release and loved the challange to intergrate it into a lot of nagios systems (and also the challenge when it did not run on windows to run it on windows)

and here it comes. i mostly allways used scripts as input for datasources.
in a sense it simplyfies the usage of cacti. but now i am working on a new client site and scripts are not an options for some items. thus snmp is for me the only option.

ok now i found out that an snmpget dont work to get a specific oid but i need an snmpwalk thus a cacti data query

i have gotten to the part i have the following xml
<interface>
<name>Get Firepass Server Sessions</name>
<description>Get Firepass Server Sessions</description>
<index_order_type>numeric</index_order_type>
<oid_index>.1.3.6.1.4.1.3375.1.10.100.4</oid_index>

<fields>
<ServerSessionsIndex>
<name>ServerSessions</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.3375.1.10.100.4</oid>
</ServerSessionsIndex>
<ServerSessions>
<name>ServerSessions</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.3375.1.10.100.4</oid>
</ServerSessions>
</fields>
</interface>
this xml gives me a result in my graphs. but as you might see the indexname server sessions all has the same OID.

my question is:

is this the way to get the name "serversessions" into the query as label?
i have no otherclue in giving that oid a name / label.

the problem is that in this setup the returned value IS the label. thus when the value does not change i dont get an error message but when it does i do.

this is my cacti log result :
02/09/2007 02:35:50 PM - SYSTEM STATS: Time:49.9437 Method:cactid Processes:1 Threads:1 Hosts:33 HostsPerProcess:33 DataSources:684 RRDsProcessed:218
02/09/2007 02:35:48 PM - CACTID: Poller[0] Host[48] DS[204] WARNING: Result from SNMP not valid. Partial Result: ...
02/09/2007 02:35:48 PM - CACTID: Poller[0] Host[47] DS[205] WARNING: Result from SNMP not valid. Partial Result: ...
ok my graphs are processed without problems. BUT as a nice system engineer i would like to have a error free log ;D

how can i solve my label problem is there a static way in that XML input section to set a static label? or what is the best way into solving this.


thanks in advance.
Attachments
firepassgraph.jpg
firepassgraph.jpg (23.64 KiB) Viewed 4320 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please find help for this at the first link of my signature. There's a complete walkthrough on SNMPWALK -> Data Query
Reinhard
soulshepard
Posts: 9
Joined: Fri Feb 09, 2007 8:20 am

Post by soulshepard »

gandalf wrote:Please find help for this at the first link of my signature. There's a complete walkthrough on SNMPWALK -> Data Query
Reinhard
Thanks for your reply.

I did allready read the walkthrough carefully and because of that i could get to were i am now (thanks ;)

but the specific problem or thing i dont understand is to do a snmpwalk with an datainput xml file and then make a correct label if i cant make a label from the oid i have. Can i then use a fake oid that prints a name or can i supply a custom name?

the moment i get errors in my logs i see the index value has changed, if not then i dotn get errors. (see attached pictures)

i will look further in the docs and forums but a pointer here would be appriciated.

thanks in advance

soulshepard
Attachments
cacticustumdata1.jpg
cacticustumdata1.jpg (12.93 KiB) Viewed 4244 times
cacticustumdata2.jpg
cacticustumdata2.jpg (12.57 KiB) Viewed 4244 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

soulshepard wrote:the moment i get errors in my logs i see the index value has changed, if not then i dotn get errors. (see attached pictures)
So please check the "re-index" method used on that data query
Reinhard
soulshepard
Posts: 9
Joined: Fri Feb 09, 2007 8:20 am

Post by soulshepard »

Reinhard,

i tested all possible re-index methods but all still give the same result

;(

- Index Count Changed
- none
- verify all fields

atm i have it on index count Changed. als i tested to uncheck or check the "Output Type ID,Index Value, Index Type" on the data template but none realy help or seem to solve it.

i think i overlook something stupid. i am a bit clueless or i fear i still dont fully grasp or understand how this should be done sorry. ;(
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Let me sum up my current knowledge of your problem
- Your running a snmp data query
- there is a problem with a text string (label), retrieved via your XML file
- the string changes from time to time
- but the number of indices (index count changed) does not change, so re-indexing does not solve
Correct?
If so, please consider running poller_reindex_hosts.php for that given host on a regularly basis
Reinhard
soulshepard
Posts: 9
Joined: Fri Feb 09, 2007 8:20 am

Post by soulshepard »

yes,

- i am running a snmp data query
- there is no label for the value i retrieve, so the label is the value.
- and yes the index count changed does not help

ok i check the poller_reindex_hosts what it does.. becuase as i see it it means i need to run this every 5 minutes because when a value changes (value=label) i get the message

but i find it strange there is no otherway to make a label for a value

i hope my questions do not come over too noobish ;D

thanks in advance

Soul
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

soulshepard wrote:... it means i need to run this every 5 minutes because when a value changes (value=label) i get the message

but i find it strange there is no otherway to make a label for a value
Currently cacti assumes that sth like a label will not change often (to be precise: only when re-indexing). And labels cannot be stored as part of rrd files. So cacti retrieves those values only when creating a new Graph or when re-indexing. It stores the data in MySQL tables to produce texts on graphs. AFAIK, cacti is not able to change those labels "efficiently" on a per poll basis.
Reinhard
soulshepard
Posts: 9
Joined: Fri Feb 09, 2007 8:20 am

Post by soulshepard »

Gandalf.

ok as u said running the poller_reindex_hosts.php periodically has done the trick.

what i have done :

as a scheduled task in my windows enviroment i have added a task for each host that has this specific error. this task thats runs the following command

"[full path to php.exe]" "[full path to poller_reindex_hosts.php]" -id=CACTIHOSTID

from the logfile here above you can see the host id's i have the problem with ( 47 and 48 )

this command is executed 1 minute before the cacti poller (every 5 minutes).

you can achieve this one minute before the poll by setting the new task schedule 4 minutes after the the cacti poller run time.

i have set the two tasks i created on the same execution time

so cacti poller runs on 5:10 and the two tasks run on 5:09 on the same time.

I am not sure if running those two tasks at the same time can hurt but i assume not because it only performs the reindex on the host Id supplied.

fortunatly in my enviroment the cacti poller runs with cactid in 54 seconds
that leaves me expanding room for another 4 minutes of runtime before i run into problems (without bouncing up hardware and threads of cactiid)

thx gandalf for your support

Soulshepard
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests