Gentoo - no graphs [Solved]

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

Moderators: Developers, Moderators

Post Reply
cpaasche
Posts: 13
Joined: Sun May 06, 2007 2:14 am

Gentoo - no graphs [Solved]

Post by cpaasche »

Hi,

I have Cacti installed on my Gentoo box. I am getting snmpwalk output from it. Also, a Windows XP box & Windows 2000.

Code: Select all

Cisco_7200 cacti # snmpwalk -v 1 -c community 192.168.100.182 .1.3.6.1.2.1.1.1.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux Cisco_7200 2.6.19-gentoo-r5 #3 SMP Sun Feb 11 23:33:09 PST 2007 i686

Cisco_7200 cacti # snmpwalk -v 1 -c community 127.0.0.1 .1.3.6.1.2.1.1.1.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux Cisco_7200 2.6.19-gentoo-r5 #3 SMP Sun Feb 11 23:33:09 PST 2007 i686

Cisco_7200 cacti # snmpwalk -v 1 -c community localhost .1.3.6.1.2.1.1.1.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux Cisco_7200 2.6.19-gentoo-r5 #3 SMP Sun Feb 11 23:33:09 PST 2007 i686
I'm using Vixie-cron

Code: Select all

Cisco_7200 cacti # crontab -u cactiuser -e

#*/5 * * * * php /var/www/localhost/htdocs/cacti/poller.php > /var/www/localhost/htdocs/cacti/poller.php 2>&1
*/5 * * * * php /var/www/localhost/htdocs/cacti/poller.php > /dev/null 2>&1
First line when uncommented just gives me email error messages in /var/log/messages so I figure it's not related.

Second line gives me this.

Code: Select all

May  5 19:20:01 Cisco_7200 cron[8175]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
May  5 19:20:01 Cisco_7200 cron[8178]: (cactiuser) CMD (php /var/www/localhost/htdocs/cacti/poller.php > /dev/null 2>&1)
May  5 19:25:01 Cisco_7200 cron[8275]: (cactiuser) CMD (php /var/www/localhost/htdocs/cacti/poller.php > /dev/null 2>&1)
From: Console -> Devices -> (Edit)

Code: Select all

Localhost (localhost)
SNMP Information
System: 00:LINUX:CISCO_7200:2.6.19-GENTOO-R5:#3:SMP:SUN:FEB:11:23:33:09:PST:2007:I686
Uptime: 447798 (0 days, 1 hours, 14 minutes)
Hostname: Cisco_7200
Location: MyLocation
Contact: Me me@somewhere.org
Image

Gentoo howto says....

Code: Select all

chown -R apache:apache rra/ log/
Tried that, didn't work so I did as in the Cacti User Manual.

Code: Select all

Cisco_7200 cacti # chown -R cactiuser:cactiuser rra/ log/
Everything else is root...is that correct? Or should it be cactiuser as owner?

Code: Select all

drwxr-xr-x 2 root      root        1928 May  4 22:35 images
drwxr-xr-x 5 root      root         528 May  4 22:40 include
-rw-r--r-- 2 root      root        2271 May  4 22:35 index.php
drwxr-xr-x 2 root      root         664 May  4 22:35 install
drwxr-xr-x 2 root      root         968 May  4 22:35 lib
drwxr-xr-x 2 cactiuser cactiuser     80 May  4 22:35 log
-rw-r--r-- 2 root      root        1796 May  4 22:35 logout.php
-rw-r--r-- 2 root      root           0 May  5 11:33 poller.php
-rw-r--r-- 2 root      root        4462 May  4 22:35 poller_commands.php
-rw-r--r-- 2 root      root        2399 May  4 22:35 poller_export.php
-rw-r--r-- 2 root      root        4417 May  4 22:35 poller_reindex_hosts.php
-rw-r--r-- 2 root      root        4244 May  4 22:35 rebuild_poller_cache.php
drwxr-xr-x 5 root      root         144 May  4 22:35 resource
drwxr-xr-x 2 cactiuser cactiuser     80 May  4 22:35 rra
-rw-r--r-- 2 root      root        7236 May  4 22:35 rra.php
-rw-r--r-- 2 root      root        7363 May  4 22:35 script_server.php
-rw-r--r-- 2 root      root         353 May  4 22:35 script_server.pl
poller.php, rra/ & log/ are empty

Code: Select all

Cisco_7200 cacti # ls -l log/ rra/ resource/
log/:
total 0
-rw-rw-r-- 1 cactiuser cactiuser 0 May  4 22:35 cacti.log

resource/:
total 0
drwxr-xr-x 2 root root 144 May  4 22:35 script_queries
drwxr-xr-x 2 root root 112 May  4 22:35 script_server
drwxr-xr-x 2 root root 248 May  4 22:35 snmp_queries

rra/:
total 0
Cisco_7200 cacti #
RRDTool

Code: Select all

ERROR: opening '/var/www/localhost/htdocs/cacti/rra/localhost_load_1min_5.rrd': No such file or directory
After looking at the Gentoo forum, this forum & the howtos, I get as far as this when looking at the Data Query Debug Information. Associated Data Queries shows success as status with 27 items in 3 rows.

Code: Select all

Data Query Debug Information
+ Running data query [1].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/localhost/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]
+ 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='Down'] index: 2 [from value]
+ Found item [ifOperStatus='Up'] index: 3 [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='MS TCP Loopback interface'] index: 1 [from value]
+ Found item [ifDescr='11a/b/g Wireless LAN Mini PCI Express Adapter - Packet Scheduler Miniport'] index: 2 [from value]
+ Found item [ifDescr='Broadcom NetXtreme Gigabit Ethernet - Packet Scheduler Miniport'] index: 3 [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]
+ Located input field 'ifSpeed' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.5'
+ Found item [ifSpeed='10000000'] index: 1 [from value]
+ Found item [ifSpeed='54000000'] index: 2 [from value]
+ Found item [ifSpeed='100000000'] index: 3 [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:16:CE:22:6A:68'] index: 2 [from value]
+ Found item [ifHwAddr='00:00:16:36:30:66:D0'] index: 3 [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='0.0.0.0'] index: 2 [from regexp oid parse]
+ Found item [ifIP='127.0.0.1'] index: 1 [from regexp oid parse]
+ Found item [ifIP='192.168.100.232'] index: 3 [from regexp oid parse]
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/snmp_queries/interface.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/snmp_queries/interface.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/snmp_queries/interface.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/snmp_queries/interface.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/snmp_queries/interface.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/snmp_queries/interface.xml'
Image

All the output is not from the same snmp host but I get the same one all of them. snmpwalk works. Data Debug Query is populated. No charts & "'/var/www/localhost/htdocs/cacti/rra/localhost_load_1min_5.rrd': No such file or directory"

Hosts say either down or unknown in Console -> Devices

Thanks in advance.
cpaasche
Posts: 13
Joined: Sun May 06, 2007 2:14 am

Post by cpaasche »

I've got this solved.

First off, I had to add bundled-adodb to my /etc/make.conf file & recompile cacti. That brought up the systems & updated the stats in Console -> Devices.

Next, I had to run "php poller.php" from the cacti directory as root....as the apache user it did not work. That populated the rra/ directory. Then I changed permissions of rra/ & log/ back to apache.

Next, I made sure the OIDs on the graphs I was trying to use were defined & made sure I could snmpwalk them. Some were not.

I was getting mysql insert errors in my log files but at least I had output as was not the case previously.

I added a cronjob for the Apache & killed the job for cactiuser. I wasn't clear on that point.

Lastly, I experimented with permissions. mysql, apache & cactiuser (& groups). I'll start pulling users out of groups & see when it breaks.

Basically A LOT of howto & forum reading did the trick along with the troubleshooting walkthrus here.
StRiP3
Posts: 4
Joined: Sun May 27, 2007 5:48 pm
Location: Haarlem, The Netherlands

Post by StRiP3 »

Dear cpaasche,

I'm having the same problem as you have...

I can snmpwalk my win2003 server, and cacti is saying that it recieves data, but there are no graps, just like in your screenshot.

In the attachment you can see my php poller.php .
It want's to create the graphs in /var/www/html/cacti/rra/ but it doesn't.

Maybe it's a rights problem? Which owner/group does /rra and /log got to have? The same as the MySQL database username??

I hope you can help me out.
Attachments
poller.txt
php poller.php
(4.19 KiB) Downloaded 153 times
StRiP3
Posts: 4
Joined: Sun May 27, 2007 5:48 pm
Location: Haarlem, The Netherlands

Post by StRiP3 »

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

Post by gandalf »

Please read installation hints at http://docs.cacti.net.
And it would be better to open a new thread instead of reusing a thread that reads solved in the title :wink:
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests