[Solved] Device OpenBSD 3.9 and SNMP V3

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

rodolphedj
Posts: 39
Joined: Tue Apr 17, 2007 8:25 am

Post by rodolphedj »

I have enable debuging.

05/04/2007 05:46:54 PM - CMDPHP: Poller[0] Host[18] DS[208] SNMP: v3: 10.33.0.6, dsname: traffic_in, oid: .1.3.6.1.2.1.2.2.1.10.2, output: U
05/04/2007 05:46:54 PM - CMDPHP: Poller[0] Host[18] DS[208] WARNING: Result from SNMP not valid. Partial Result:
05/04/2007 05:46:52 PM - CMDPHP: Poller[0] Host[18] DS[208] SNMP: v3: 10.33.0.6, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.2, output: U
05/04/2007 05:46:52 PM - CMDPHP: Poller[0] Host[18] DS[208] WARNING: Result from SNMP not valid. Partial Result:

Do you understand the problem ?


The snmpwalk in line command return :
#snmpwalk -v3 -u myuser -l authNoPriv -A ***** 10.33.0.6 .1.3.6.1.2.1.2.2.1.16.2
>IF-MIB::ifOutOctets.2 = Counter32: 100074018
rodolphedj
Posts: 39
Joined: Tue Apr 17, 2007 8:25 am

Post by rodolphedj »

one error found :
If I use the template "Unix - Processes", there is not warning.
Samething for template "Unix - Load Average"
It is false. Data from server Cacti :cry: (perhaps bug)

Nobody use here OpenBSD like device for monitoring ?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

The UNIX type templates only work for the local host. They use scripts against local ressources
Reinhard
rodolphedj
Posts: 39
Joined: Tue Apr 17, 2007 8:25 am

Post by rodolphedj »

Ok, Thanks for this details.
But I didn't understand the reason, why openBSD can not monitoring ?? :cry:
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Have a look at those scripts. Find them at ./scripts. You will see some simple shell commands. Try to execute them at command line. I suspect they will fail. That's why cacti can't retrieve data. If you replace those shell commands by the correct OpenBSD stuff, it will start to work.
Personally, I would stick to the SNMP based companions. They are more universal
Reinhard
rodolphedj
Posts: 39
Joined: Tue Apr 17, 2007 8:25 am

Post by rodolphedj »

gandalf wrote:Personally, I would stick to the SNMP based companions. They are more universal
I didn't understand. :-?

And by snmpwalk result is done.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

It is possible to graph those values using another approach. Apply the "ucd/net Host Template" to that host and use the new Graph Templates associated with your target (This assumes, you've snmpd up and running on the target which is localhost in this case).
Reinhard
rodolphedj
Posts: 39
Joined: Tue Apr 17, 2007 8:25 am

Post by rodolphedj »

are you an idea why this templates :
netsnmp_memory_usage
http://forums.cacti.net/viewtopic.php?t ... mory_usage
-> perfect result graph by snmp ! :D

and "WARNING: Result from SNMP not valid. Partial Result:" with traffic templates the from the Data Query [SNMP - Interface Statistics] on Cacti ?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please verify that php-snmp is installed. Restart httpd, then. Select "Verbose Query" from the device afterwards
Reinhard
rodolphedj
Posts: 39
Joined: Tue Apr 17, 2007 8:25 am

Post by rodolphedj »

Becarful, with all my other devices i can obtain graphic of traffic.

Device OpenBSD 3.9

verbose query result is good :
+ Running data query [1].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/srv/www/htdocs/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]
+ Found item [ifIndex='7'] index: 7 [from value]
+ Located input field 'ifOperStatus' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.8'
+ Found item [ifOperStatus='Up'] index: 1 [from value]
+ Found item [ifOperStatus='Up'] index: 2 [from value]
+ Found item [ifOperStatus='Up'] index: 3 [from value]
+ Found item [ifOperStatus='Up'] index: 4 [from value]
+ Found item [ifOperStatus='Up'] index: 5 [from value]
+ Found item [ifOperStatus='Down'] index: 6 [from value]
+ Found item [ifOperStatus='Down'] index: 7 [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='lo0'] index: 1 [from value]
+ Found item [ifDescr='fxp0'] index: 2 [from value]
+ Found item [ifDescr='xl0'] index: 3 [from value]
+ Found item [ifDescr='rl0'] index: 4 [from value]
+ Found item [ifDescr='pflog0'] index: 5 [from value]
+ Found item [ifDescr='pfsync0'] index: 6 [from value]
+ Found item [ifDescr='enc0'] index: 7 [from value]
+ Located input field 'ifName' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.31.1.1.1.1'
+ Located input field 'ifAlias' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.31.1.1.1.18'
+ Located input field 'ifType' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.3'
+ Found item [ifType='softwareLoopback(24)'] 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='245'] index: 5 [from value]
+ Found item [ifType='246'] index: 6 [from value]
+ Found item [ifType='244'] index: 7 [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='0'] index: 1 [from value]
+ Found item [ifSpeed='100000000'] index: 2 [from value]
+ Found item [ifSpeed='100000000'] index: 3 [from value]
+ Found item [ifSpeed='100000000'] index: 4 [from value]
+ Found item [ifSpeed='0'] index: 5 [from value]
+ Found item [ifSpeed='0'] index: 6 [from value]
+ Found item [ifSpeed='0'] index: 7 [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=''] index: 1 [from value]
+ Found item [ifHwAddr='00:00:50:8B:11:A3:A7'] index: 2 [from value]
+ Found item [ifHwAddr='00:00:10:5A:9F:BA:E4'] index: 3 [from value]
+ Found item [ifHwAddr='00:00:30:F1:1B:08:78'] index: 4 [from value]
+ Found item [ifHwAddr=''] index: 5 [from value]
+ Found item [ifHwAddr=''] index: 6 [from value]
+ Found item [ifHwAddr=''] index: 7 [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='10.33.0.6'] index: 2 [from regexp oid parse]
+ Found item [ifIP='10.33.9.1'] index: 3 [from regexp oid parse]
+ Found item [ifIP='10.33.10.1'] index: 4 [from regexp oid parse]
+ Found item [ifIP='127.0.0.1'] index: 1 [from regexp oid parse]
+ Found data query XML file at '/srv/www/htdocs/cacti/resource/snmp_queries/interface.xml'
+ Found data query XML file at '/srv/www/htdocs/cacti/resource/snmp_queries/interface.xml'
+ Found data query XML file at '/srv/www/htdocs/cacti/resource/snmp_queries/interface.xml'
rodolphedj
Posts: 39
Joined: Tue Apr 17, 2007 8:25 am

Post by rodolphedj »

Only for developer :
1 - on line command
/usr/bin/snmpget -O vt -v3 -t 20 -r 1 10.33.0.6:161 -u ********* -l authNoPriv -a MD5 -A ************************* .1.3.6.1.2.1.2.2.1.10.2
Counter32: 558750468

2 - code program (lib/snmp.php)
$snmp_value = @snmp3_get("$hostname:$port", $username, "authNoPriv", "MD5", $password, "", "", $oid, ($timeout * 1000), $retries);
work with some device, but not OpenBSD


I didn't understand the problem ???
rodolphedj
Posts: 39
Joined: Tue Apr 17, 2007 8:25 am

Post by rodolphedj »

3 - on test.php

code result OK :lol: :

<?php

$string = @snmp3_get("10.33.0.6:161", ********, "authNoPriv", "MD5", ***********, "", "", ".1.3.6.1.2.1.2.2.1.16.2", 1000, 2);

echo $string;

?>
rodolphedj
Posts: 39
Joined: Tue Apr 17, 2007 8:25 am

Post by rodolphedj »

solution temporary good...

file cacti/lib/snmp.php
line 65

$snmp_value = @snmp3_get("$hostname:$port", $username, "authNoPriv", "MD5", $password, "", "", "$oid", ($timeout * 1000), $retries);


strange : sometimes when i modify code (hard modify ) :wink: I need restart apache... :-?
rodolphedj
Posts: 39
Joined: Tue Apr 17, 2007 8:25 am

Post by rodolphedj »

it is not the best solution...

After, I am some problem with other devices.... :( :(
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

can't you use SNMP v2c with :
  • user / password
  • IP restriction
  • non trivial community name
?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest