TCP Port Template

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

Moderators: Developers, Moderators

cskp12
Posts: 21
Joined: Thu Jun 18, 2009 8:52 pm

Post by cskp12 »

jerrison wrote: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é
how do you fix this issue ,please tell me
thx
my cacti version:0.87e
User avatar
Vins
Cacti User
Posts: 116
Joined: Tue Sep 12, 2006 3:06 am

Post by Vins »

jerrison wrote:Hi there,

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 :).
It helped me! :D

Problem solved, really thanks
User avatar
trik
Posts: 12
Joined: Mon Sep 21, 2009 2:21 pm

Post by trik »

Vins wrote:
jerrison wrote:Hi there,

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 :).
It helped me! :D

Problem solved, really thanks
Me too !

Thanks !
Debian 5.0.3 / Php 5.2.6
Cacti 0.8.7e / Spine 0.8.7e
DimmON
Posts: 14
Joined: Thu Apr 02, 2009 3:05 am

The RRD file does not exist

Post by DimmON »

Hi. I have a problem. This template had been working good until today morning. But now he refuses to make a new RRD file. When I creating a new TCP graphs he does not make any RRD files yet. Another templates makes graphs fine. Help my please to solve my problem.
Attachments
Result
Result
cacti_2.jpg (33.55 KiB) Viewed 11770 times
Add
Add
cacti_1.jpg (28.74 KiB) Viewed 11770 times
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Verify permissions on the RRA directory
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
DimmON
Posts: 14
Joined: Thu Apr 02, 2009 3:05 am

The RRD file does not exist

Post by DimmON »

permissions on the RRA directory are 777
I think that the problem is something else because if I use any other templates(memory,cpu,disk space etc..) rrd files makes correctly.
Cacti Version - 0.8.7e
Plugin Architecture - 2.6
Poller Type - Cactid v
Server Info - Linux 2.6.9-89.0.20.ELsmp
Web Server - Apache/2.0.63 (CentOS)
PHP - 5.1.6
PHP Extensions - libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, standard, SimpleXML, sockets, SPL, shmop, session, Reflection, pspell, posix, mime_magic, iconv, hash, gmp, gettext, ftp, exif, date, curl, ctype, calendar, bz2, zlib, pcre, openssl, apache2handler, gd, ldap, mysql, mysqli, PDO, pdo_mysql, pdo_sqlite, snmp, eAccelerator
MySQL - 5.0.82sp1
RRDTool - 1.2.23
SNMP - 5.1.2
Plugins
  • Thresholds (thold - v0.4.1)
    Global Plugin Settings (settings - v0.5)
    Large Site Performane Booster for Cacti (boost - v2.2)
    PHP Network Managing (PHP Network Managing - v0.6.1)
    Network Discovery (discovery - v0.8.5)
    Network Tools (tools - v0.3)
    Syslog Monitoring (syslog - v0.5.2)
    Device Tracking (mactrack - v1.1)
    Login Page Mod (loginmod - v1.0)
    Update Checker (update - v0.4)
    FlowView (flowview - v0.6)
    Host Info (hostinfo - v0.2)
    Error Images (errorimage - v0.1)
    PHP Network Weathermap (weathermap - v0.96a)
    docs
    Cacti-ReportIt (reportit - v0.6.1)
    Router Configs (routerconfigs - v0.1)
    WMI Query (wmi - v0.1)
    Realtime for Cacti (realtime - v0.35)
zummer
Posts: 2
Joined: Mon Sep 27, 2010 4:11 am

Re: TCP Port Template

Post by zummer »

Hi All

I use cacti version 0.8.7g when create TCP graph , I have error in my graph

please help me to fix it
Attachments
2011-01-11_154814.JPG
2011-01-11_154814.JPG (28.14 KiB) Viewed 10991 times
User avatar
guoyang
Posts: 1
Joined: Mon Nov 29, 2010 9:55 pm

Re: TCP Port Template

Post by guoyang »

zummer wrote:Hi All

I use cacti version 0.8.7g when create TCP graph , I have error in my graph

please help me to fix it
Hello!I had came accrocess the same thing as you!
However ,after I alter the graph template ,put the Last cf to average ,It become ok!
wish to help you!
zummer
Posts: 2
Joined: Mon Sep 27, 2010 4:11 am

Re: TCP Port Template

Post by zummer »

guoyang wrote:
zummer wrote:Hi All

I use cacti version 0.8.7g when create TCP graph , I have error in my graph

please help me to fix it
Hello!I had came accrocess the same thing as you!
However ,after I alter the graph template ,put the Last cf to average ,It become ok!
wish to help you!
Thank you , I alter the graph template from Last to average, It OK
Attachments
2011-01-16_065126.jpg
2011-01-16_065126.jpg (56 KiB) Viewed 10967 times
brononius
Posts: 27
Joined: Fri Dec 30, 2011 4:53 am

Re: TCP Port Template

Post by brononius »

guoyang wrote:
zummer wrote:However ,after I alter the graph template ,put the Last cf to average ,It become ok!
wish to help you!
Did the trick for me too...


Thanks!!!
Cacti: 0.8.7i PIA on Ubuntu (linuxmce) with NET-SNMP 5.4.1 / RRDTool 1.2.x
Plugins: Manage062, Syslog122, Mactrack29, Settings071, Weathermap097a, Quicktree02, Thold049, Configmanager0826, Aggregate070, Realtime043, Nettools015
Private use: 24 hosts (and trying to integrate it into linuxmce)
Professional use 1635 nodes with 3616 graphs (backup / syslog / weathermaps...)
prospero63
Posts: 48
Joined: Sun Apr 12, 2009 7:51 pm

Re: TCP Port Template

Post by prospero63 »

Sorry to dredge up an old thread, but I'm having some issues with this template. I had the no RRA's issue and changed to average from last to fix that. I also made the change to the tcp.xml from print to return. When I monitor port 22 the value returned is 4. Any ideas why?
throberth
Posts: 2
Joined: Fri Nov 11, 2011 5:53 am

Re: TCP Port Template

Post by throberth »

In Management > Devices > Host > Data Query TCP (Verbose Query)

Code: Select all

+ Running data query [15].
+ Found type = '6' [Script Query - Script Server].
+ Found data query XML file at '/var/www/cacti/resource/script_server/tcp.xml'
+ XML file parsed ok.
+ <arg_num_indexes> missing in XML file, 'Index Count Changed' not supported
+ Executing script for list of indexes '"/usr/bin/php" -q /var/www/cacti/scripts/tcp.php Host 63 index' Index Count: 1
+ Found index: 
+ Executing script query '"/usr/bin/php" -q /var/www/cacti/scripts/tcp.php Host 63 query index'
+ Found item [ServiceIndex='53'] index: 53
+ Found item [ServiceIndex='389'] index: 389
In Management > Data Sources > Host - TCP > Turn On Data Source Debug Mode

Code: Select all

Data Source Debug

/usr/bin/rrdtool create \
/var/www/cacti/rra/storage_-_sede_tcp_1726.rrd \
--step 300  \
DS:TCP:GAUGE:600:0:1 \
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:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
In Management > Graph Management > Host - TCP State - PORT > Turn On Graph Debug Mode

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='Host - TCP State - 53' \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit='0' \
--vertical-label= \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a='/var/www/cacti/rra/storage_-_sede_tcp_1726.rrd':'TCP':LAST \
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
In /var/log/httpd/error_log

Code: Select all

ERROR: the RRD does not contain an RRA matching the chosen CF
Anyone been through this, help?
Thiago Roberth
KendyBober
Posts: 2
Joined: Thu Dec 25, 2014 2:45 am

Re: TCP Port Template

Post by KendyBober »

I have a problem:

+ Running data query [16].
+ Found type = '6' [Script Query - Script Server].
+ Found data query XML file at '/usr/share/cacti/resource/script_server/tcp.xml'
+ XML file parsed ok.
+ <arg_num_indexes> missing in XML file, 'Index Count Changed' not supported
+ Executing script for list of indexes '"/usr/bin/php" -q /usr/share/cacti/scripts/tcp.php 192.168.4.237 156 index' Index Count: 2
+ Found index:
+ Found index: Warning: Missing argument 4 for TCP() in /var/lib/cacti/scripts/tcp.php on line 33
+ Executing script query '"/usr/bin/php" -q /usr/share/cacti/scripts/tcp.php 192.168.4.237 156 query index'
+ Found item [ServiceIndex='HTTP'] index: 80
+ Found item [ServiceIndex='HTTP SSL'] index: 443

Only 80 and 443 ports detected, but exist 3389 and 8905 (I added these ports in ports.inc) and if I run on cacti server:
/usr/share/cacti/scripts/tcp.php 192.168.4.237 156 query index
these ports have been viewed:
3389!RDP
8905!SSI
80!HTTP
443!HTTP SSL

Why template doesn't reads all ports?
KendyBober
Posts: 2
Joined: Thu Dec 25, 2014 2:45 am

Re: TCP Port Template

Post by KendyBober »

Problem has been solved.
SElinux permissions has blocked some ports.
Now is off and all ports are viewed!
orchius
Posts: 3
Joined: Sun Feb 01, 2015 1:09 am

Re: TCP Port Template

Post by orchius »

This attachment is latest bug fixed TCP port template.
Enjoy! :)
Attachments
TCP Port Template.zip
This attachment is latest bug fixed TCP port template.
Enjoy! :)
(8.07 KiB) Downloaded 553 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests