Cisco PIX problem

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Andrea

Cisco PIX problem

Post by Andrea »

I have problem with Cisco PIX interface.
So i check the interface but I havent description.
So i have see the interfaces.xml
<fields>
<ifIndex>
<name>Index</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.2.2.1.1</oid>
</ifIndex>
<ifDesc>
<name>Description</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.2.2.1.2</oid>
</ifDesc>

If i try to query my pix i receive:
[root@test-noc snmp_queries]# snmpwalk -c public -v 1 ecf000 .1.3.6.1.2.1.2.2.1.1
IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifIndex.2 = INTEGER: 2
IF-MIB::ifIndex.3 = INTEGER: 3
IF-MIB::ifIndex.4 = INTEGER: 4
IF-MIB::ifIndex.5 = INTEGER: 5
IF-MIB::ifIndex.6 = INTEGER: 6
I try descriptio
[root@test-noc snmp_queries]# snmpwalk -c public -v 1 ecf000 .1.3.6.1.2.1.2.2.1.2
IF-MIB::ifDescr.1 = STRING: PIX Firewall 'red' interface
IF-MIB::ifDescr.2 = STRING: PIX Firewall 'inside' interface
IF-MIB::ifDescr.3 = STRING: PIX Firewall 'dmz' interface
IF-MIB::ifDescr.4 = STRING: PIX Firewall 'fe-backup' interface
IF-MIB::ifDescr.5 = STRING: PIX Firewall 'failover-link' interface
IF-MIB::ifDescr.6 = STRING: PIX Firewall 'fe-admin' interface
So when i check the cacti page i have not a description. any idea to hel me?


Thank
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

RE: Cisco PIX problem

Post by rony »

I'm having the same problem with my pix. :o

I would dare to say it's related to the single quotes in the description of the interface. But uncertain, anyone else having this problem?

Also, I must note that when you do go the create graphs, the decription is missing from the interface list.

OS: Redhat 9.0
Cacti: 0.8.5a

Anyone know of a solution?

Here is the Verbose Query from the Interface Verbose Query.

Code: Select all

+ Running data query [1].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/local/cacti/resource/snmp_queries/interface.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.2.2.1.1'
+ Located input field 'ifIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.1'
+ Found item [ifIndex='1'] index: 1 [from value]
+ Found item [ifIndex='2'] index: 2 [from value]
+ Found item [ifIndex='3'] index: 3 [from value]
+ Found item [ifIndex='4'] index: 4 [from value]
+ Found item [ifIndex='5'] index: 5 [from value]
+ Found item [ifIndex='6'] index: 6 [from value]
+ Located input field 'ifDescr' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.2'
+ Found item [ifDescr='PIX Firewall 'outside' interface'] index: 1 [from value]
+ Found item [ifDescr='PIX Firewall 'inside' interface'] index: 2 [from value]
+ Found item [ifDescr='PIX Firewall 'dmz' interface'] index: 3 [from value]
+ Found item [ifDescr='PIX Firewall 'open0' interface'] index: 4 [from value]
+ Found item [ifDescr='PIX Firewall 'engineering' interface'] index: 5 [from value]
+ Found item [ifDescr='PIX Firewall 'service' interface'] index: 6 [from value]
+ Located input field 'ifName' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.31.1.1.1.1'
+ Found item [ifName=''] index: [from value]
+ Located input field 'ifAlias' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.31.1.1.1.18'
+ Found item [ifAlias=''] index: [from value]
+ Located input field 'ifType' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.3'
+ Found item [ifType='ethernetCsmacd(6)'] index: 1 [from value]
+ Found item [ifType='ethernetCsmacd(6)'] index: 2 [from value]
+ Found item [ifType='ethernetCsmacd(6)'] index: 3 [from value]
+ Found item [ifType='ethernetCsmacd(6)'] index: 4 [from value]
+ Found item [ifType='ethernetCsmacd(6)'] index: 5 [from value]
+ Found item [ifType='ethernetCsmacd(6)'] index: 6 [from value]
+ Located input field 'ifSpeed' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.5'
+ Found item [ifSpeed='100000000'] index: 1 [from value]
+ Found item [ifSpeed='100000000'] index: 2 [from value]
+ Found item [ifSpeed='100000000'] index: 3 [from value]
+ Found item [ifSpeed='10000000'] index: 4 [from value]
+ Found item [ifSpeed='10000000'] index: 5 [from value]
+ Found item [ifSpeed='10000000'] index: 6 [from value]
+ Located input field 'ifHwAddr' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.6'
+ Found item [ifHwAddr='00:00:50:54:FF:C7:2E'] index: 1 [from value]
+ Found item [ifHwAddr='00:00:50:54:FF:C7:2F'] index: 2 [from value]
+ Found item [ifHwAddr='00:00:E0:B6:01:8F:DA'] index: 3 [from value]
+ Found item [ifHwAddr='00:00:E0:B6:01:8F:D9'] index: 4 [from value]
+ Found item [ifHwAddr='00:00:E0:B6:01:8F:D8'] index: 5 [from value]
+ Found item [ifHwAddr='00:00:E0:B6:01:8F:D7'] index: 6 [from value]
+ Located input field 'ifIP' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.4.20.1.2'
+ Found item [ifIP='xxx.xxx.xxx.130'] index: 1 [from regexp oid parse]
+ Found item [ifIP='xxx.xxx.xxx.161'] index: 3 [from regexp oid parse]
+ Found item [ifIP='xxx.xxx.xxx.1'] index: 5 [from regexp oid parse]
+ Found item [ifIP='xxx.xxx.xxx.1'] index: 6 [from regexp oid parse]
+ Found item [ifIP='xxx.xxx.xxx.1'] index: 2 [from regexp oid parse]
Tomeq
Posts: 24
Joined: Thu Dec 05, 2002 2:22 pm

Post by Tomeq »

Same here.. no descripions for interfaces, whatever I do. Still haven't found any solution....
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Ian, you have any ideas.

I was going to dive into the source this weekend, any particular file I should focus on?

Thanks,
Guest

Post by Guest »

Found the problem.

When the snmp query is executed, it places the results in an array. This array is then passed to a data query function that parses the results into the database. When the query to replace/insert the record is generated, there is no code or function to fix single quotes. As a quick fix, and Ian will be able to tell me if this is the best way, I have a patch that patches the snmp.php file to remove single quotes from the returned array of snmp values.

The attached patch is for Cacti 0.8.5a it is untested with any other version.

To execute be in the cacti/lib directory and type patch snmp.php < Cacti-0.8.5a-snmp_single_quote.patch

Don't forget to backup the orignal first and that you need to ungzip the patch.. :)

Good luck.

Btw, forgot to login.. Opps
Rony
Attachments
Cacti-0.8.5a-snmp_single_quote.patch.gz
Patch for Cacti 0.8.5a to correct single quotes problem with SNMP data.
(145 Bytes) Downloaded 404 times
Guest

Post by Guest »

Hmm... so, no function for fixing single quotes is a common problem around Cacti. Just do the simple test : name any graph, and use the single quote ( ' )... you'll see no title on graph and just a blank on listview of graphs.. no matter if it is a PIX or SQUID cache.

Could anyone try it and make a fix? (there could be more single quote problems inside cacti)

Greets,
Tomek
Bookmarc
Posts: 18
Joined: Fri May 07, 2004 12:02 pm

Post by Bookmarc »

Hi all !

Just found out I have the exact same problem...
An official path would greatly help those of us with Cisco PIX.


Thx !
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Single quote problems are not easy to test, I have had simular problems in my own code for years. As a way of combating it, I always pass all values that are going to be used in an SQL statement through a function that corrects single quotes.

Perl Sub Routine Example:

Code: Select all

sub database_sql_fix {
  my ($SQL) = @_;
  $SQL =~ s/\'/\'\'/g;
  return $SQL;
}
The concept is simple, the implementation after the fact is not always easy.

The ultimate fix is the review the source code and fix all the SQL statements. But this can be a daunting task.



Also, I noticed that the text that was inserted into the database for the ifdesc from the pix was truncated. Apparently it is to long, maybe an increase in the size of that column in the database would resolve this problem. My only question is would it have adverse effects on other functions in cacti.

Just a thought.

Rony
Tomeq
Posts: 24
Joined: Thu Dec 05, 2002 2:22 pm

Post by Tomeq »

Hm. The patch is not working, nothing has changed - I still can't get cacti to query for ifName or ifAlias on my PIX...

So, by now, still no solution for PIXes...

Greets,
Tomek
Bookmarc
Posts: 18
Joined: Fri May 07, 2004 12:02 pm

Post by Bookmarc »

Try to refresh the interfaces.
Go in devices and click on verbose something... ;)

You should see the Names without the single quotes listed in the 'ifDescr' part...

Worked fine for me.

Another thing that's interesting is that PIXes often list their interface as :

Code: Select all

PIX FireWall 'inside' interface
So you could also add another line in snmp.php that removes the "PIX Firewall" part... I add a problem were the name was too long and got truncated.
Guest

Post by Guest »

But, I have no problem refreshing or verbosing the query. The query is just the same as in other Ciscos, every "ifDescr" is gathered properly, everything is indexed as well. But I still can't get cacti to do the graph titles.... :(

I see no errors at all, traffic is gathered properly, but no titles, only something like this "PIX - (|query_Ifdescr| / |query_ifAlias)" (this is an example). I've tried everything... no success.

What am I doing wrong?

Greets,
Tomek
Guest

Post by Guest »

I really like Cacti but the issues it has with the PIX are a killer for me. I *must* be able to monitor memory, cpu, and connection usage on my PIXen. Back to MRTG for me, unless someone posts a concrete "how to" guide to get it to work.
Tomeq
Posts: 24
Joined: Thu Dec 05, 2002 2:22 pm

Post by Tomeq »

Ok, I must correct what I've written previously : the patch posted before is working well. It strips single quotes, which solves the problem.

(PIX returns interface names in single quotes, that's the key, which I've seen before ;) verbosing the query)

Another hint: PIX does not accept SNMP v2 and v3 (at least in PIXOS 6.2). Use only v1 to get anything. And don't use 64 bit counters for traffic monitoring, this is not working too.

Greets,
Tomek
peanut

pix

Post by peanut »

patch worked for me, newbie to cacti and so far love it..

I had to apply the patch man, edit snmp.php directly and added the lines:

/* remove All single quotes */
$string = str_replace("'", "", $string);

right under the existing str_replace of:

/* remove ALL quotes */
$string = str_replace("\"", "", $string);


after that nuked the data source and rebuilt the graphs, all good.. upon regen it will have ifdesc in the pull down then just regen and ur done..

looks like its cutin off the desc a litle but thats ok I'll just trim down the title..

thanks

-s
Ghandi
Cacti User
Posts: 73
Joined: Tue May 04, 2004 5:09 am
Location: Graz / Austria

Post by Ghandi »

hi,

i have the same problem, but its a little bit more mystery, in my case i have one machine with windows xp, on this pc cacti is running and the snmp query for the pix is also nice.

then i have copied, the folder of cacti, and all others which cacti uses to a new machine with windows 2000 server, in this case cacti is also running, and the interface statistics for the pix are also nice, BUT.. the snmp information give the following error

SNMP error

i have copied the lines like peanut have describe it, but the problem isn't gone, can anybody help me?

cu ghandi
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests