Fortigate graph CPU & Memory Usage

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

Moderators: Developers, Moderators

Post Reply
6lv1
Posts: 8
Joined: Wed Apr 13, 2011 9:08 am

Fortigate graph CPU & Memory Usage

Post by 6lv1 »

Hi all,

I'm currently trying to set up a graphing solution based on Cacti (see technical info attached).

My objective is graphing each four CPU consumption and memory usage. I first have retrieved Fotigate template provided by Fortinet :

Code: Select all

http://kb.fortinet.com/kb/microsites/search.do?cmd=displayKC&docType=kc&externalId=13833&sliceId=1&docTypeID=DT_KCARTICLE_1_1&dialogID=17173009&stateId=0%200%2017171678
After having created graphs for my device (it is a 3810A), I enter in "Graph Management" section and selected any graph, I encounter a first error message complaining that the rrd doest not exist. Consequently I have no other choice than creating it manually like this:

Code: Select all

# touch /var/www/cacti/rra/fgtsgcclab_5min_cpu_152.rrd
# chown cacti:cacti /var/www/cacti/rra/fgtsgcclab_5min_cpu_152.rrd
Then I refresh the page and this time I encounter an other error message:

Code: Select all

ERROR: mmaping file '/var/www/cacti/rra/fgtsgcclab_5min_cpu_152.rrd': Invalid argument
What does this error mean and how fixing it ?

I thank you in advance for your help.

Regards,
6lv1
Attachments
Console - Utilities - Technical Support.zip
Cacti technical support page.
(22.72 KiB) Downloaded 128 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Fortigate graph CPU & Memory Usage

Post by gandalf »

6lv1 wrote:Consequently I have no other choice than creating it manually like this:

Code: Select all

# touch /var/www/cacti/rra/fgtsgcclab_5min_cpu_152.rrd
# chown cacti:cacti /var/www/cacti/rra/fgtsgcclab_5min_cpu_152.rrd
You should not do this. You've created a file that is not an rrd file.
Cacti creates the file on its own in case everything is fine with the target device and with the scripts used.
So I suppose that the problem lies with the scripts or with downed host detection
R.
6lv1
Posts: 8
Joined: Wed Apr 13, 2011 9:08 am

Re: Fortigate graph CPU & Memory Usage

Post by 6lv1 »

Hi,

Thank you gandalf for your reply.
You should not do this. You've created a file that is not an rrd file.
So I guess I Should remove all my manually-created files ? How and when cacti creates the rrd files ?
When I enter in Graph Management section, does cacti creates the rrd file if everything works fine ?
So I suppose that the problem lies with the scripts or with downed host detection
Host is not down; as a proof, SNMP Information are well retrieved:
fgtLab (XXX.XXX.XXX.XXX)
SNMP Information
System:FW 3810A SNMP Agent
Uptime: 420998183 (48 days, 17 hours, 26 minutes)
Hostname: XXXXXX
Location: France
Contact: 6lv1
I thank you for your help.
Regards,
6lv1
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Fortigate graph CPU & Memory Usage

Post by gandalf »

6lv1 wrote:Hi,

Thank you gandalf for your reply.
You should not do this. You've created a file that is not an rrd file.
So I guess I Should remove all my manually-created files ? How and when cacti creates the rrd files ?
When I enter in Graph Management section, does cacti creates the rrd file if everything works fine ?
Cacti will create the data sources (rrd files) when running the poller through crontab.
So I suppose that the problem lies with the scripts or with downed host detection
Host is not down; as a proof, SNMP Information are well retrieved:
fgtLab (XXX.XXX.XXX.XXX)
SNMP Information
System:FW 3810A SNMP Agent
Uptime: 420998183 (48 days, 17 hours, 26 minutes)
Hostname: XXXXXX
Location: France
Contact: 6lv1
Please see 2nd link of my sig for different possibilities
R.
6lv1
Posts: 8
Joined: Wed Apr 13, 2011 9:08 am

Re: Fortigate graph CPU & Memory Usage

Post by 6lv1 »

Hi,

I've remove all manually-created rrd files. Now I've created a basic template that should display memory usage of the 3810A under testing and in fact rrd file has been automatically created via cron.

Now I see following error message in cacti log file:

Code: Select all

04/20/2011 04:22:01 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'0', SQL:"REPLACE INTO settings (name,value) VALUES ('stats_recache','RecacheTime:0.0 HostsRecached:0')'
04/20/2011 04:22:01 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'0', SQL:"SELECT COUNT(*) FROM poller_command"
04/20/2011 04:22:01 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'0', SQL:"REPLACE INTO settings (name,value) VALUES ('stats_poller','Time:0.0080 Method:cmd.php Processes:1 Threads:N/A Hosts:0 HostsPerProcess:0 DataSources:0 RRDsProcessed:0')' 
What is this about and how to fix it ?

Thanks again !

Edit: I've noticed that if I enter manually SQL requests into MySQL shell, they work perfectly fine... strange!
6lv1
Posts: 8
Joined: Wed Apr 13, 2011 9:08 am

Re: Fortigate graph CPU & Memory Usage

Post by 6lv1 »

Finally, I've updated file database.php from http://svn.cacti.net/viewvc/cacti/branc ... p?view=log and now it seems to work fine.

By cons during my debug phase I run following command:

Code: Select all

php -q cmd.php 0 14
And now I see following message in Cact's log:
04/20/2011 07:58:01 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/cacti/cmd.php" 0 14]
Of course, response is :
04/20/2011 08:02:02 PM - POLLER: Poller[0] NOTE: There are no items in your poller for this polling cycle!
How to definitively stop this task ?

Thanks.
6lv1
Posts: 8
Joined: Wed Apr 13, 2011 9:08 am

Re: Fortigate graph CPU & Memory Usage

Post by 6lv1 »

Hello,

Is this message normal ?
04/20/2011 07:58:01 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/cacti/cmd.php" 0 14]
Thanks in advance
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Fortigate graph CPU & Memory Usage

Post by gandalf »

6lv1 wrote:Hello,

Is this message normal ?
04/20/2011 07:58:01 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/cacti/cmd.php" 0 14]
Thanks in advance
yes. that's an info only
R.
6lv1
Posts: 8
Joined: Wed Apr 13, 2011 9:08 am

[Solved] Re: Fortigate graph CPU & Memory Usage

Post by 6lv1 »

Thank you gandalf for your support.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest