Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


TCP Port Template
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
gilles
Cacti User


Joined: 12 Jul 2005
Posts: 237

PostPosted: Wed Oct 04, 2006 1:23 pm    Post subject: TCP Port Template Reply with quote

This a TCP Port Template.

It let you graph the state of a TCP port :



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.



This is derivate from my Plugin Manage and Cacti users without Plugin Architecture can use it.
Back to top
gilles
Cacti User


Joined: 12 Jul 2005
Posts: 237

PostPosted: Wed Oct 11, 2006 2:43 pm    Post subject: Reply with quote

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.
Back to top
gilles
Cacti User


Joined: 12 Jul 2005
Posts: 237

PostPosted: Fri Nov 02, 2007 4:17 am    Post subject: Reply with quote

i have just updated the template to be compatible with cacti 0.8.7
Back to top
cacti_008



Joined: 06 Nov 2006
Posts: 2

PostPosted: Sun Nov 11, 2007 10:31 pm    Post subject: Reply with quote

Hi, I cann't download the tcp.zip, where can I get it? Thx!
Back to top
KyRoo



Joined: 19 Oct 2007
Posts: 47

PostPosted: Fri Nov 16, 2007 9:24 am    Post subject: Reply with quote

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
Back to top
mcutting
Cacti Guru User


Joined: 16 Oct 2006
Posts: 1804
Location: United Kingdom

PostPosted: Fri Nov 16, 2007 9:29 am    Post subject: Reply with quote

KyRoo - I still have the TCP template that is compatible with 0.8.6j...
Back to top
KyRoo



Joined: 19 Oct 2007
Posts: 47

PostPosted: Fri Nov 16, 2007 10:36 am    Post subject: Reply with quote

mcutting wrote:
KyRoo - I still have the TCP template that is compatible with 0.8.6j...


TY, works perfect now
Back to top
Jem



Joined: 12 Apr 2005
Posts: 27

PostPosted: Mon Dec 10, 2007 10:32 am    Post subject: Reply with quote

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
Back to top
oven



Joined: 24 Mar 2007
Posts: 8

PostPosted: Tue Dec 18, 2007 9:09 pm    Post subject: Re: TCP Port Template Reply with quote

gilles wrote:
This a TCP Port Template.

It let you graph the state of a TCP port :



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.



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 ?
Back to top
bcarpio



Joined: 04 Jun 2008
Posts: 6

PostPosted: Thu Jun 05, 2008 10:08 pm    Post subject: Reply with quote

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
Back to top
gueutzilla



Joined: 13 Jul 2008
Posts: 9

PostPosted: Wed Jul 30, 2008 10:36 am    Post subject: Reply with quote

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???

Thanks



TCP-err1.jpg
 Description:
2nd attachment
 Filesize:  220.32 KB
 Viewed:  10788 Time(s)

TCP-err1.jpg



TCP-err.jpg
 Description:
1st attachment
 Filesize:  265.32 KB
 Viewed:  10788 Time(s)

TCP-err.jpg


Back to top
jerrison



Joined: 29 Dec 2006
Posts: 48

PostPosted: Tue Mar 03, 2009 4:49 am    Post subject: Reply with quote

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é
Back to top
ssabchew



Joined: 23 Feb 2009
Posts: 2

PostPosted: Thu Mar 05, 2009 11:33 am    Post subject: Reply with quote

[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
Back to top
killshoot
Cacti User


Joined: 26 Mar 2008
Posts: 72

PostPosted: Tue Mar 31, 2009 7:16 am    Post subject: Reply with quote

By me the result is always "0" even if the port is really open. Any suggestion?
Back to top
pthaynes
Cacti User


Joined: 20 Apr 2009
Posts: 54
Location: Australia

PostPosted: Mon Apr 20, 2009 7:01 pm    Post subject: TCP Templates Reply with quote

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?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group