Hello community,
I did not found any set of scripts/templates to check port(-s) status of a specific device, so had to make my own.
Yes, I know - manage plug-in has this feature, but I've also needed a port scanner in addition.
A data-query uses nmap to scan host and detect services running
And resulting charts (it measures time to establish socket connectivity, which should be in ms at most)
however, due to some strange issues related with php and nmap - a scan might happen much faster in some cases (i.e. it might take 6 seconds for a data query to reload instead of 30), but with reduced amount of info avaiable (can't figure why this happens - please write me if you have some ideas). Anyway - it works.
ps: by default nmap scans for TCP ports. You can adjust it's command-line parameters on your own, but existing version of script checks only for TCP ports - small fix might be necessary if you're interested in UDP as well.
ps: don't forged to edit socket_states.php to change nmap and tmp folder paths.
ps2: not tested on windows
ps3: php-xml extension is required!
tested on: freebsd, debian, centos
nmap: 3.7, 5.x
port status templates with automated port discovery v00.01
Moderators: Developers, Moderators
port status templates with automated port discovery v00.01
- Attachments
-
- socket_states.tar.gz
- v00.01 (tiny error updated at line 184 at socket_states.php)
- (5.33 KiB) Downloaded 199 times
-
- socket_states.zip
- v00.01 (tiny error updated at line 184 at socket_states.php)
- (6.42 KiB) Downloaded 189 times
Last edited by johnrembo on Mon Jul 26, 2010 8:25 am, edited 4 times in total.
[url=http://forums.cacti.net/viewtopic.php?t=24934&highlight=zond]zond plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?t=28384]memorize plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?p=141322#141322]transporter plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?t=28384]memorize plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?p=141322#141322]transporter plugin[/url]
Re: z
look aboveunnamed wrote:hmmmm I'm sorry but where is socket_states.xml ..
you must download uncompressed .xml file + compressed .php file (.zip or .gzip)
[url=http://forums.cacti.net/viewtopic.php?t=24934&highlight=zond]zond plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?t=28384]memorize plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?p=141322#141322]transporter plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?t=28384]memorize plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?p=141322#141322]transporter plugin[/url]
Re: z
johnrembo wrote:you must download uncompressed .xml file + compressed .php file (.zip or .gzip)
Code: Select all
+ Running data query [34].
+ Found type = '4 '[script query].
+ Could not find data query XML file at '.../resource/script_queries/socket_states.xml'
+ Error parsing XML file into an array.
+ Could not find data query XML file at '.../resource/script_queries/socket_states.xml'
+ Could not find data query XML file at '.../resource/script_queries/socket_states.xml'
+ Could not find data query XML file at '.../resource/script_queries/socket_states.xml'
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec
Re: z
oh crap, sorryshd wrote:johnrembo wrote:you must download uncompressed .xml file + compressed .php file (.zip or .gzip)uncompressed xml file is not enough - it is a template export.Code: Select all
+ Running data query [34]. + Found type = '4 '[script query]. + Could not find data query XML file at '.../resource/script_queries/socket_states.xml' + Error parsing XML file into an array. + Could not find data query XML file at '.../resource/script_queries/socket_states.xml' + Could not find data query XML file at '.../resource/script_queries/socket_states.xml' + Could not find data query XML file at '.../resource/script_queries/socket_states.xml'
I've repacked and reattached the files - should be fine now
[url=http://forums.cacti.net/viewtopic.php?t=24934&highlight=zond]zond plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?t=28384]memorize plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?p=141322#141322]transporter plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?t=28384]memorize plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?p=141322#141322]transporter plugin[/url]
Oh, I must have missed that...gilles wrote:right, manage can't do that
but there is a workaround in the ports template
i don't recommend this (php time limit on scripts if you use this) but you can edit scripts/ports.inc to specifically add any port you want to scan
1 port per line...
then run a Verbose Query
Well, theoreticaly I had same idea - to build a php-based port-discovery tool, yet, after digging more into nmap's advanced features it became obvious - you can't perform that fast on php side (I'm not even mentioning App./OS Discovery features).
Anyway, Gilles, maybe you've come with some i.e. data_input template that could use you port checking scripts to graph (visualize) historical port availability? That's the major thing I've missed in "Manage".
[url=http://forums.cacti.net/viewtopic.php?t=24934&highlight=zond]zond plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?t=28384]memorize plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?p=141322#141322]transporter plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?t=28384]memorize plugin[/url]
[url=http://forums.cacti.net/viewtopic.php?p=141322#141322]transporter plugin[/url]
Who is online
Users browsing this forum: No registered users and 6 guests