Bluecoat Proxy Template (inc fan & temp) (2005/09/19)

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Author
Message
cmarsot
Posts: 29
Joined: Tue Sep 13, 2005 5:30 am
Contact:

#16 Post by cmarsot » Wed Oct 05, 2005 4:37 am

Availability and percent is part of addon:
http://forums.cacti.net/viewtopic.php?t=9272

If you don't need these graph, delete them from host template

riz
Posts: 14
Joined: Fri Aug 05, 2005 2:38 am

#17 Post by riz » Mon Oct 10, 2005 10:56 am

Sorry if this is a really basic question but I'm getting the following when trying to import:

############################################
Graph Template

[success] #PRX03 - Proxy - HTTP Client Requests (and Hits) [update]
[success] #PRX02 - Proxy - CPU Load [update]
[success] #PRX04 - Proxy - HTTP Server Requests [update]
[success] #PRX08 - Proxy - Hit Ratio [update]
+ Found Dependency: (Data Template Item) hr_objects
+ Found Dependency: (GPRINT Preset) Percentage
+ Found Dependency: (Data Template Item) hr_bytes
+ Unmet Dependency: (Data Template Item)
+ Found Dependency: (CDEF) Unknown-Data
+ Found Dependency: (GPRINT Preset) Normal
[success] #PRX09 - Proxy - Workers [update]
[success] #_Availability [update]
[success] #_Response Time [update]
[success] #PRX10 - Proxy - Temperature [update]
[success] #PRX11 - Proxy - Fan [update]
[success] Interface - Traffic (bits/sec) [update]
[success] Interface - Packets Errors/Discards [update]
[success] Interface - Packets Unicast [update]
[success] Interface - Packets Non-Unicast [update]
[success] Interface - Traffic (bytes/sec) [update]
[success] Interface - Traffic (bits/sec, 95th Percentile, Total Bandwith) [update]
[success] Interface - Traffic (bits/sec, Total Bandwidth) [update]
[success] Interface - Traffic (bytes/sec, Total Bandwidth) [update]

############################################

If anyone could help me in the right direction, I'd much appreciate it, thanks.

regards,
riz.

riz
Posts: 14
Joined: Fri Aug 05, 2005 2:38 am

Scripts

#18 Post by riz » Sun Oct 16, 2005 4:21 am

I have muddled through this and now have working graphs! :roll:

But I can't get the 'availability' and 'response time' graphs to display any data?? (graph is grey with nan)

Please somebody help! :cry:


I also have a problem with using the admin password in the scripts!

I don't know if this is because I've configured my setup incorrectly..
but, the scripts directory is in /www/html/cacti/scripts!!

Although I have directory listing disabled on Apache, if you type in the full path in a browser
(http://<IP address>/cacti/scripts/proxySG_sensors_temp.pl) I am prompted to download the file!! :o

I tried using .htaccess to restrict access to the /www/html/cacti directory, which did prompt me for a user/password but all my graphs stopped working! :cry:

Is there a way to not have the password in the actual script, but point it to another file that isn't in www/html/xxx/xxx?

I'd really appreciate some helps here fellas!

cheers,
riz.

riz
Posts: 14
Joined: Fri Aug 05, 2005 2:38 am

#19 Post by riz » Sun Oct 16, 2005 6:55 am

I have sorted out the permissions on /cacti/scripts and is now more secure.. :roll: ...ok, n00b alert I know, but we all have to start somewhere!

the response times and availability graphs are still getting the better of me, but after 24 hours of looking at it, I just can't figure it out so am going fishing! *HELP!!*


this is the output when in debug:

Code: Select all

[size=9]10/16/2005 12:40:03 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti/rra/bluecoat_proxysg2_responsetime_50.rrd --template responsetime 1129462801:U  
10/16/2005 12:40:03 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti/rra/bluecoat_proxysg2_availability_49.rrd --template availability 1129462801:U  
10/16/2005 12:40:03 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti/rra/bluecoat_proxysg2_hr_objects_48.rrd --template hr_bytes:hr_objects 1129462801:36:46  
10/16/2005 12:40:03 PM - POLLER: Poller[0] Parsed MULTI output field 'cpu2:27.8' [map cpu2->cpu2]  
10/16/2005 12:40:03 PM - POLLER: Poller[0] Parsed MULTI output field 'cpu1:27.8' [map cpu1->cpu1]  
10/16/2005 12:40:03 PM - POLLER: Poller[0] Parsed MULTI output field 'mb1:25.3' [map mb1->mb1]  
10/16/2005 12:40:03 PM - POLLER: Poller[0] Parsed MULTI output field 'objects:46' [map objects->hr_objects]  
10/16/2005 12:40:03 PM - POLLER: Poller[0] Parsed MULTI output field 'bytes:36' [map bytes->hr_bytes]  
10/16/2005 12:40:03 PM - CMDPHP: Poller[0] Time: 1.5405 s, Theads: N/A, Hosts: 1  
10/16/2005 12:40:03 PM - PHPSVR: Poller[0] DEBUG: PHP Script Server Shutdown request received, exiting  
10/16/2005 12:40:03 PM - CMDPHP: Poller[0] Host[5] DS[56] CMD: perl /var/www/html/cacti/scripts/proxySG_sensors_temp.pl 10.134.12.111, output: mb1:25.3 cpu1:27.8 cpu2:27.8  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] Host[5] DS[55] SNMP: v2: 10.134.12.111, dsname: snmp_oid, oid: .1.3.6.1.3.25.17.3.2.2.1.0, output: 4499407  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] Host[5] DS[53] SNMP: v2: 10.134.12.111, dsname: snmp_oid2, oid: .1.3.6.1.3.25.17.3.2.1.2.0, output: 2459727  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] Host[5] DS[52] SNMP: v2: 10.134.12.111, dsname: snmp_oid, oid: .1.3.6.1.4.1.3417.2.4.1.1.1.4.1, output: 3  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] Host[5] DS[51] SNMP: v2: 10.134.12.111, dsname: traffic_in, oid: .1.3.6.1.2.1.2.2.1.10.2, output: 455708357  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] Host[5] DS[51] SNMP: v2: 10.134.12.111, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.2, output: 1070806165  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] Host[5] DS[54] SNMP: v2: 10.134.12.111, dsname: snmp_oid1, oid: .1.3.6.1.3.25.17.3.2.1.1.0, output: 5397708  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] Host[5] DS[50] CMD: /var/www/html/cacti/scripts/host_availability_current.php 10.134.12.111, output: U  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] Host[5] DS[50] WARNING: Result from CMD not valid. Partial Result:  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] Host[5] DS[49] CMD: /var/www/html/cacti/scripts/host_availability_percent.php 10.134.12.111, output: U  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] Host[5] DS[49] WARNING: Result from CMD not valid. Partial Result:  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] Host[5] DS[48] CMD: perl /var/www/html/cacti/scripts/proxySG_hit_ratio.pl 10.134.12.111, output: bytes:36 objects:46  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] Host[5] RECACHE: Processing 1 items in the auto reindex cache for '10.134.12.111'.  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] Host[5] SNMP: Host responded to SNMP  
10/16/2005 12:40:02 PM - CMDPHP: Poller[0] PHP Script Server Started Properly  [/size]

I don't have a /scripts/host_availability_percent.php file!! :o where the heck is that then??!

HEEEEEEEEELLLLLLLP!!!! ....please!

nope, had enough...gone fishing!

drose12
Posts: 31
Joined: Thu Mar 10, 2005 11:02 am

#20 Post by drose12 » Mon Dec 05, 2005 4:07 pm

Anyone ever come across the host_availability_percent.php script?

cmarsot
Posts: 29
Joined: Tue Sep 13, 2005 5:30 am
Contact:

#21 Post by cmarsot » Tue Dec 06, 2005 6:10 am

Here is the script:

#!/usr/bin/php -q
<?php
include(dirname(__FILE__) . "/../include/config.php");
$ip = $HTTP_SERVER_VARS['argv'][1];
$server = $database_hostname;
$db = mysql_connect($database_hostname, $database_username, $database_password);
mysql_select_db($database_default, $db);
$sql="SELECT * FROM host WHERE hostname = '$ip'";
$result=mysql_query($sql, $db);
while ($row = mysql_fetch_array($result)) {
$avail = $row['availability'];
}
echo trim($avail);
exit(0);
?>

You couls also with a search find this:
http://forums.cacti.net/about8230.html& ... ailability

merlinx2040
Posts: 2
Joined: Thu Feb 24, 2005 2:00 pm

#22 Post by merlinx2040 » Thu Dec 08, 2005 6:54 am

In case anyone was wondering about the host_availability_current.php , here it is:

Code: Select all

#!/usr/bin/php -q
<?php
include(dirname(__FILE__) . "/../include/config.php");
$ip = $HTTP_SERVER_VARS['argv'][1];
$server = $database_hostname;
$db = mysql_connect($database_hostname, $database_username, $database_password);
mysql_select_db($database_default, $db);
$sql="SELECT * FROM host WHERE hostname = '$ip'";
$result=mysql_query($sql, $db);
while ($row = mysql_fetch_array($result)) {
$current = $row['cur_time'];
}
echo trim($current);
exit(0);
?>
:wink:

alphademon
Posts: 8
Joined: Tue Jul 26, 2005 1:57 am

disk usage?

#23 Post by alphademon » Mon Feb 20, 2006 8:43 pm

cmarsot wrote:Availability and percent is part of addon:
http://forums.cacti.net/viewtopic.php?t=9272

If you don't need these graph, delete them from host template
Hi Cmarsot.. is there anyway to find out the disk usage on the bluecoat appliance ?

omurillo
Posts: 1
Joined: Wed Apr 05, 2006 3:29 pm

Re: Bluecoat Proxy Template (inc fan & temp) (2005/09/19

#24 Post by omurillo » Wed Apr 05, 2006 3:51 pm

Hi! I'm new at this, but I was able to get cacti up and running. Ok I have 2 questions. 1 - You said "DO NOT FORGET to change username/password in perl script" which perl script?

2 - When I try to import I get the following error:

Warning: filesize() [function.filesize]: stat failed for C:\WINDOWS\TEMP\phpE.tmp in c:\Inetpub\wwwroot\cacti\templates_import.php on line 59

Warning: fread() [function.fread]: Length parameter must be greater than 0 in c:\Inetpub\wwwroot\cacti\templates_import.php on line 59

Warning: Cannot modify header information - headers already sent by (output started at c:\Inetpub\wwwroot\cacti\templates_import.php:59) in c:\Inetpub\wwwroot\cacti\templates_import.php on line 71

cmarsot wrote:Hi,

Here is a template for Bluecoat Proxy (based on the one done by Morgan)
http://forums.cacti.net/viewtopic.php?t ... t=bluecoat

Here what it graphs:
- Traffic
- CPU Load
- HTTP Clients Requests / Clients Hits
- HTTP Proxy Requests (Server requests)
- Hit Ratio (Objects, Bytes)
- Workers (Max specified by licence, and current)
- Availability
- Response Time
- Fan Speed : CPU, Chassis (new)
- Temperature : CPU, Motherboard (new)


DO NOT FORGET to change username/password in perl script.

When CPU Temp is not available (like CPU2 on ProxySG 800) the return value is 0.
When Fan speed is not available (like fan on CPU 2 on proxySG 800), the return value is defined to 10. I decided not to define to 0 due to thold Alerts.

Temperature & Fan Speed DO NOT WORK on ProxySG400 (information are not available in sysinfo).
Both scripts (Fan Speed & Temperature) must be modified to work with CacheFlow.

Have Fun !

bidzer
Posts: 30
Joined: Tue Jun 20, 2006 12:49 pm

Anyone get the Perl Scripts working?

#25 Post by bidzer » Wed Jun 21, 2006 1:46 pm

I've been able to get the SNMP stuff to work, but I've been unable to get the hit ratio and workers to work at all.

nohare
Posts: 3
Joined: Fri Jun 30, 2006 8:53 am

#26 Post by nohare » Fri Jun 30, 2006 9:02 am

I am a newbie to Cacti and so far have been able to install and monitor via SNMP Bluecoat devices.
.
I have downloaded and imported the Bluecoat XML templates, and have also copied the "workers" scripts to the relevant directory.

Can anyone assist with being getting cacti to retrieve the workers values?

I have created a Data Input Method called "Bluecoat HTTP Workers" which has "perl <path_cacti>/scripts/proxysg_workers.pl <ip>" as the input string (I tried to copyuse exisiting data Input Methods). Then I have specified two Output Fields, one called "Current Workers" the other called "Max Workers"

Under Data Templates, I created two entries, one called "Bluecoat Proxy - HTTP Workers - Current" and the other called "Bluecoat Proxy - HTTP Workers - Max".

I then created a Graph Template called "Bluecoat Proxy - HTTP Workers" which two Graph Template Items (one for current, one for max). I also created two Graph Item Inputs (one for current, one for max).

This is as far as I have got and have been unable to get cacti retrieving the data which I want to plot.

Can anyone help?

bidzer
Posts: 30
Joined: Tue Jun 20, 2006 12:49 pm

#27 Post by bidzer » Fri Jun 30, 2006 9:24 am

nohare,

Are you using https and port 8082 to connect to your bluecoat? I had to play around with the scripts to get them to work with my cache engine. I ran the poller.php manually and saw that the poller was looking for the wrong script name.

nohare
Posts: 3
Joined: Fri Jun 30, 2006 8:53 am

#28 Post by nohare » Fri Jun 30, 2006 9:32 am

Bidzer,

I am using http:8081 to connect to my bluecoat, I have checked this and the browser can connect successfully.

nohare
Posts: 3
Joined: Fri Jun 30, 2006 8:53 am

#29 Post by nohare » Fri Jun 30, 2006 10:23 am

I am also seeing this in my cacti.log file

06/30/2006 04:05:56 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select output_string from data_input where id=14"
06/30/2006 04:06:32 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select output_string from data_input where id=14"
06/30/2006 04:06:45 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select output_string from data_input where id=14"
06/30/2006 04:06:49 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select output_string from data_input where id=14"
06/30/2006 04:06:51 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select output_string from data_input where id=14"
06/30/2006 04:06:54 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select output_string from data_input where id=14"
06/30/2006 04:08:26 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select output_string from data_input where id=14"
06/30/2006 04:08:29 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select output_string from data_input where id=14"
06/30/2006 04:08:33 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select output_string from data_input where id=14"



Any Ideas ?

bidzer
Posts: 30
Joined: Tue Jun 20, 2006 12:49 pm

#30 Post by bidzer » Fri Jun 30, 2006 11:00 am

I never received that error. Have you tried to run the scripts manually from the command line? It will tell you if the scripts have any problems and what lines to focus. Can you try this and post the errors?

Post Reply