summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/discovery.inc.php
diff options
context:
space:
mode:
authorsasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-07 14:16:21 +0000
committersasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-07 14:16:21 +0000
commit6f2e181732084950f1cab209f308347460dc290e (patch)
tree010c0b87f1e21a62d39d3e4dc283f4a283076ac1 /frontends/php/include/discovery.inc.php
parent4c4c7ec61d8d890ff596acbc2737aa0f36d54d6f (diff)
downloadzabbix-6f2e181732084950f1cab209f308347460dc290e.tar.gz
zabbix-6f2e181732084950f1cab209f308347460dc290e.tar.xz
zabbix-6f2e181732084950f1cab209f308347460dc290e.zip
- [DEV-108] GUI - Autodiscovery
git-svn-id: svn://svn.zabbix.com/trunk@5461 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/discovery.inc.php')
-rw-r--r--frontends/php/include/discovery.inc.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/frontends/php/include/discovery.inc.php b/frontends/php/include/discovery.inc.php
index 9c138e2e..20270f54 100644
--- a/frontends/php/include/discovery.inc.php
+++ b/frontends/php/include/discovery.inc.php
@@ -36,6 +36,29 @@
return false;
}
+ function svc_default_port($type_int)
+ {
+ $port = 0;
+
+ switch($type_int)
+ {
+ case SVC_SSH: $port = 22; break;
+ case SVC_LDAP: $port = 389; break;
+ case SVC_SMTP: $port = 25; break;
+ case SVC_FTP: $port = 21; break;
+ case SVC_HTTP: $port = 80; break;
+ case SVC_POP: $port = 110; break;
+ case SVC_NNTP: $port = 119; break;
+ case SVC_IMAP: $port = 143; break;
+ case SVC_TCP: $port = 80; break;
+ case SVC_AGENT: $port = 10050; break;
+ case SVC_SNMPv1:$port = 161; break;
+ case SVC_SNMPv2:$port = 161; break;
+ }
+
+ return $port;
+ }
+
function discovery_check_type2str($type_int)
{
$str_type[SVC_SSH] = S_SSH;
@@ -57,6 +80,16 @@
return S_UNKNOWN;
}
+ function discovery_port2str($type_int, $port)
+ {
+ $port_def = svc_default_port($type_int);
+
+ if ($port != $port_def)
+ return '['.$port.']';
+
+ return '';
+ }
+
function discovery_status2str($status_int)
{
switch($status_int)