Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu May 23, 2019 8:52 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: TCP Port Template
PostPosted: Wed Oct 04, 2006 1:23 pm 
Offline
Cacti User
User avatar

Joined: Tue Jul 12, 2005 8:16 pm
Posts: 250
This a TCP Port Template.

It let you graph the state of a TCP port :

Image

You can then set a treshold on it.

http://gilles.boulon.free.fr/tcp/tcp.zip

To use, unzip the template, import xml files and place appropriates files in scripts and ressources.
Not all of the 65535 ports will be tested (too long i think...), so you must edit file ports.inc.
Then go to Associated Data Queries, add TCP, click verbose and go to graphs.

Image

This is derivate from my Plugin Manage and Cacti users without Plugin Architecture can use it.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 11, 2006 2:43 pm 
Offline
Cacti User
User avatar

Joined: Tue Jul 12, 2005 8:16 pm
Posts: 250
The template has been updated because it modify your rra settings.

You will experience this problem :
http://forums.cacti.net/viewtopic.php?t=16647

To correct this :
- use these steps http://forums.cacti.net/viewtopic.php?t=16541
or
- reimport the new TCP Port Template
or
- reimport another good template like this one http://forums.cacti.net/viewtopic.php?t=16618

I'm sorry for the inconvenience.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 02, 2007 4:17 am 
Offline
Cacti User
User avatar

Joined: Tue Jul 12, 2005 8:16 pm
Posts: 250
i have just updated the template to be compatible with cacti 0.8.7


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 11, 2007 10:31 pm 
Offline

Joined: Mon Nov 06, 2006 1:56 am
Posts: 2
Hi, I cann't download the tcp.zip, where can I get it? Thx!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 16, 2007 9:24 am 
Offline
Cacti User

Joined: Fri Oct 19, 2007 10:19 am
Posts: 51
Hi Gillis,

i'm currently teting your cool plugin, but i have a problem

ive installed your manage plugin. everything seems to work. When i bring down a tcp port the manage tool detects that. But when i display the graph, it is always down.
when i look at my poller log i see that it returns the U value.

i've installed this when the zip was updates for version 0.8.7, but i run 0.8.6j. I think this could be the problem.

Do you still have the previous version?


debug info:
Code:
Data Query Debug Information

+ Running data query [12].
+ Found type = '6 '[script query].
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_server/tcp.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'c:\php\php.exe -q C:\Inetpub\wwwroot\cacti\scripts\tcp.php localhost 2 index'
+ Executing script query 'c:\php\php.exe -q C:\Inetpub\wwwroot\cacti\scripts\tcp.php localhost 2 query index'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_server/tcp.xml'



Code:
Data Query [TCP]   

This data query returned 0 rows, perhaps there was a problem executing this data query. You can run this data query in debug mode to get more information.


Thx,
KyRoo


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 16, 2007 9:29 am 
Offline
Cacti Guru User

Joined: Mon Oct 16, 2006 5:57 am
Posts: 1874
Location: United Kingdom
KyRoo - I still have the TCP template that is compatible with 0.8.6j...

_________________
Quote:
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 16, 2007 10:36 am 
Offline
Cacti User

Joined: Fri Oct 19, 2007 10:19 am
Posts: 51
mcutting wrote:
KyRoo - I still have the TCP template that is compatible with 0.8.6j...


TY, works perfect now 8)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 10, 2007 10:32 am 
Offline
User avatar

Joined: Tue Apr 12, 2005 4:36 pm
Posts: 35
Hello,

I tried to use this but it's not working for me, I have an error in my cacti log file:

12/10/2007 04:27:40 PM - CMDPHP: Poller[0] Host[2] DS[35] WARNING: Result from SERVER not valid. Partial Result: Invalid include/conf

Host and DS are for my localhost with TCP query on port 80...

Here is my Data Source Debug:

Code:
Data Source Debug

/usr/syno/bin/rrdtool create \
/volume1/web/cacti/rra/uranus_tcp_35.rrd \
--step 300  \
DS:TCP:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:500 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:500 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \


If it can help...

And my log in DEBUG mode:

Code:
12/10/2007 05:52:27 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (35, 'TCP', '2007-12-10 17:52:15', 'U')"
12/10/2007 05:52:27 PM - CMDPHP: Poller[0] Host[2] DS[35] SERVER: /volume1/web/cacti/scripts/tcp.php TCP 192.168.78.7 2 get TCP 80, output: U
12/10/2007 05:52:27 PM - CMDPHP: Poller[0] Host[2] DS[35] WARNING: Result from SERVER not valid. Partial Result: Invalid include/conf
12/10/2007 05:52:26 PM - PHPSVR: Poller[0] DEBUG: INC: '/volume1/web/cacti/scripts/tcp.php' FUNC: 'TCP' PARMS: '192.168.78.7 2 get TCP 80'


Thanks for your answers


Top
 Profile  
 
 Post subject: Re: TCP Port Template
PostPosted: Tue Dec 18, 2007 9:09 pm 
Offline

Joined: Sat Mar 24, 2007 8:55 am
Posts: 10
gilles wrote:
This a TCP Port Template.

It let you graph the state of a TCP port :

Image

You can then set a treshold on it.

http://gilles.boulon.free.fr/tcp/tcp.zip

To use, unzip the template, import xml files and place appropriates files in scripts and ressources.
Not all of the 65535 ports will be tested (too long i think...), so you must edit file ports.inc.
Then go to Associated Data Queries, add TCP, click verbose and go to graphs.

Image

This is derivate from my Plugin Manage and Cacti users without Plugin Architecture can use it.



Code:
RRDTool Command:

/usr/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="OCN Proxy - TCP State - 80" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/html/cacti/rra/ocn_proxy_tcp_155.rrd":TCP:LAST \
DEF:b="/var/www/html/cacti/rra/ocn_proxy_tcp_155.rrd":TCP:AVERAGE \
AREA:a#EA8F00FF:"TCP"  \
GPRINT:a:LAST:"%8.0lf\n"  \
COMMENT:"(1 = Running, 0 = Stopped)"

RRDTool Says:

ERROR: the RRD does not contain an RRA matching the chosen CF

WHo can help me ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 05, 2008 10:08 pm 
Offline

Joined: Wed Jun 04, 2008 8:42 pm
Posts: 6
I installed this and all my queries in debug mode show no errors, however the graph never displays here is the error I get in my /var/log/httpd/error_log:

the RRD does not contain an RRA matching the chosen CF


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 30, 2008 10:36 am 
Offline

Joined: Sun Jul 13, 2008 10:28 am
Posts: 9
Hi,

I have a problem whith graph on TCP template for all my devices.

The snmp query is ok and return :
Quote:
5) TCP (Verbose Query) Uptime Goes Backwards Success [7 Items, 7 Rows]

In verbose :
Quote:
+ Running data query [16].
+ Found type = '6 '[script query].
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'D:\Web\PHP5\php.exe -q D:\Web\Cacti\scripts\tcp.php 172.17.170.8 53 index'
+ Executing script query 'D:\Web\PHP5\php.exe -q D:\Web\Cacti\scripts\tcp.php 172.17.170.8 53 query index'
+ Found item [ServiceIndex='80'] index: 80
+ Found item [ServiceIndex='443'] index: 443
+ Found item [ServiceIndex='110'] index: 110
+ Found item [ServiceIndex='995'] index: 995
+ Found item [ServiceIndex='25'] index: 25
+ Found item [ServiceIndex='143'] index: 143
+ Found item [ServiceIndex='993'] index: 993
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'


In the graph tabs, there is no graph for "|host_description| -TCP -".

In the cacti Console -> Graph Management , I turn on debug mod and I have the result in the first attachment.

In the Cacti Console -> Data Sources I turn on debug mode and have the result in second attachment.


The poller run properly and return correct value : 1 for port status.

In the cacti log file have this errors :
Quote:
07/30/2008 05:30:21 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1224.
07/30/2008 05:30:20 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1218.
07/30/2008 05:30:20 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1219.
07/30/2008 05:30:20 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1222.
07/30/2008 05:30:20 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1223.
07/30/2008 05:30:20 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1221.
07/30/2008 05:30:20 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1220.
07/30/2008 05:30:16 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1212.
07/30/2008 05:30:14 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1242.
07/30/2008 05:30:10 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1257.
07/30/2008 05:30:10 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1259.



My cacti is 8.7.b with rrdtool 1.2.x (lastest version) and only graph for TCP template not working!!!

Can you help me??? :roll:

Thanks


Attachments:
File comment: 2nd attachment
TCP-err1.jpg
TCP-err1.jpg [ 220.32 KiB | Viewed 43633 times ]
File comment: 1st attachment
TCP-err.jpg
TCP-err.jpg [ 265.32 KiB | Viewed 43633 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 03, 2009 4:49 am 
Offline
Cacti User

Joined: Fri Dec 29, 2006 4:02 am
Posts: 55
Hi there,

thanks for the templates.
Just to give some information on how i got them to work with the latest cactiEZ-distribution: i need to edit your tcp.php script, line 54 and 57 (print "0", print "1"). Instead of "printing" the retun values i "returned" them:
return "0", return "1".
I had all "NaN" before, poller output was "1U" instead of only "1" or "0".

Hope this might help someone :).

Greetz,
André


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 05, 2009 11:33 am 
Offline

Joined: Mon Feb 23, 2009 7:27 am
Posts: 2
[quote="gueutzilla"]Hi,

I have a problem whith graph on TCP template for all my devices.

The snmp query is ok and return :
[quote]5) TCP (Verbose Query) Uptime Goes Backwards Success [7 Items, 7 Rows][/quote]
In verbose :
[quote]+ Running data query [16].
+ Found type = '6 '[script query].
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'D:\Web\PHP5\php.exe -q D:\Web\Cacti\scripts\tcp.php 172.17.170.8 53 index'
+ Executing script query 'D:\Web\PHP5\php.exe -q D:\Web\Cacti\scripts\tcp.php 172.17.170.8 53 query index'
+ Found item [ServiceIndex='80'] index: 80
+ Found item [ServiceIndex='443'] index: 443
+ Found item [ServiceIndex='110'] index: 110
+ Found item [ServiceIndex='995'] index: 995
+ Found item [ServiceIndex='25'] index: 25
+ Found item [ServiceIndex='143'] index: 143
+ Found item [ServiceIndex='993'] index: 993
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'
+ Found data query XML file at 'D:/Web/Cacti/resource/script_server/tcp.xml'[/quote]

In the graph tabs, there is no graph for "|host_description| -TCP -".

In the cacti Console -> Graph Management , I turn on debug mod and I have the result in the first attachment.

In the Cacti Console -> Data Sources I turn on debug mode and have the result in second attachment.


The poller run properly and return correct value : 1 for port status.

In the cacti log file have this errors :
[quote]07/30/2008 05:30:21 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1224.
07/30/2008 05:30:20 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1218.
07/30/2008 05:30:20 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1219.
07/30/2008 05:30:20 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1222.
07/30/2008 05:30:20 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1223.
07/30/2008 05:30:20 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1221.
07/30/2008 05:30:20 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1220.
07/30/2008 05:30:16 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1212.
07/30/2008 05:30:14 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1242.
07/30/2008 05:30:10 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1257.
07/30/2008 05:30:10 PM - CMDPHP: Poller[0] ERROR: There are no RRA's assigned to local_data_id: 1259.[/quote]


My cacti is 8.7.b with rrdtool 1.2.x (lastest version) and only graph for TCP template not working!!!

Can you help me??? :roll:

Thanks[/quote]


I have EXACTLY the same problem...
cacti version - 0.8.7d

PLease HEEeeEEeeelp


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 31, 2009 7:16 am 
Offline
Cacti User

Joined: Wed Mar 26, 2008 2:51 am
Posts: 84
By me the result is always "0" even if the port is really open. Any suggestion?


Top
 Profile  
 
 Post subject: TCP Templates
PostPosted: Mon Apr 20, 2009 7:01 pm 
Offline
Cacti User

Joined: Mon Apr 20, 2009 1:29 am
Posts: 56
Location: Australia
I noticed that my graphs for the TCP ports I am monitoring always show as down (ie a value of 0). Digging a little further I noticed that within the data template for TCP the "Maximum Value" was 0 (look under Console > Data templates - it's about half way down the page). I've changed that to 1 and now my TCP ports show as up.

I assume that was the right thing to do... if it is could someone please update the templates in the original source location?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group