Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


squery_ifAlias - char length

 
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions
Author Message
monideth
Cacti User


Joined: 03 Apr 2003
Posts: 91

PostPosted: Fri Apr 11, 2003 8:39 am    Post subject: squery_ifAlias - char length Reply with quote

Hi,

I am using Cacti 0.8 (cacti-0.8-pre20030411.tar.gz).

I have modified resource/snmp_queries/interface.xml to:

<ifAlias>
<name>Alias</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.31.1.1.1.18</oid>
</ifAlias>

This allows me to use the Cisco IOS configured interface description as ifAlias.

I have aslo modified the Data Query for "SNMP - Interface Statistics" / "In/Out Bits" so that the "Graph Template" section only has the following:

title |squery_ifAlias|

However, when I create a graph is "Polling Hosts" section, I notice that the text for ifAlias has been cropped.

It seems there is a max char size of 15 for the squery_ifAlias pointer?

Is this a correct observation? Is there anyway to increase this value?

If only I can get past this problem then Cacti 0.8 is perfect (for now! )

Regards,

Mon
Back to top
monideth
Cacti User


Joined: 03 Apr 2003
Posts: 91

PostPosted: Fri Apr 11, 2003 9:28 am    Post subject: Reply with quote

I think I have solved it!

You will in include/functions.php the following line (364):

Code:
$string = stri_replace($l_escape_string . "squery_" . $data["field_name"] . $r_escape_string, substr($data["field_value"],0,15), $string);


If your change the '15' value to an appropriately sized value - for example:

Code:
$string = stri_replace($l_escape_string . "squery_" . $data["field_name"] . $r_escape_string, substr($data["field_value"],0,64), $string);


I don't know what other implications changing this values raises. Can anybody confirm that this is ok!

Regards,

Mon
Back to top
raX
Lead Developer


Joined: 13 Oct 2001
Posts: 2234
Location: Carlisle, PA

PostPosted: Fri Apr 11, 2003 10:45 am    Post subject: Reply with quote

I am glad you you were able to figure this out. The reason I added this was to prevent really long graph titles from being created. I will take a closer look tonight, but a better approach might be to trim the title in the UI instead of in the database. I could also make it a user-configurable option if I had to.

-Ian
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group