diff --git a/Gopkg.lock b/Gopkg.lock index 471a300..22b54c0 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -78,7 +78,7 @@ "telnet", "wmi" ] - revision = "f5a697e4d15125f4fcae754a56b71e5b1d00e57c" + revision = "297c909956a0892b9e547370384012cbe2992b9d" [[projects]] branch = "master" @@ -110,7 +110,7 @@ "model/sensorconfig", "service/probe" ] - revision = "687985e7f2122d12e43a0111f13d6df9921c3d82" + revision = "7e2ff26648aefbafaee2ca28c1a958332ae4c6f9" [[projects]] branch = "master" @@ -126,7 +126,7 @@ branch = "master" name = "git.loafle.net/overflow/crawler-go" packages = ["."] - revision = "377582c76e19dcd275b6746ac519340c4625d32b" + revision = "bae05dbc820773ec5b584cb39614216dd408a7f7" [[projects]] name = "github.com/BurntSushi/toml" @@ -228,10 +228,11 @@ "ed25519", "ed25519/internal/edwards25519", "internal/chacha20", + "internal/subtle", "poly1305", "ssh" ] - revision = "8ac0e0d97ce45cd83d1d7243c060cb8461dda5e9" + revision = "7f39a6fea4fe9364fb61e1def6a268a51b4f3a06" [[projects]] name = "gopkg.in/yaml.v2" diff --git a/crawler/crawler.go b/crawler/crawler.go index 48d768c..1d0a73b 100644 --- a/crawler/crawler.go +++ b/crawler/crawler.go @@ -61,7 +61,7 @@ func init() { } func addCrawler(c crawler.Crawler) { - crawlers[c.Name()] = c + crawlers[c.Key()] = c } diff --git a/crawler/health/activedirectory/ActiveDirectoryHealthCrawler.go b/crawler/health/activedirectory/ActiveDirectoryHealthCrawler.go index dff1722..de00d9a 100644 --- a/crawler/health/activedirectory/ActiveDirectoryHealthCrawler.go +++ b/crawler/health/activedirectory/ActiveDirectoryHealthCrawler.go @@ -11,7 +11,7 @@ type ActiveDirectoryHealthCrawler struct { health.SocketHeahthCrawler } -func (c *ActiveDirectoryHealthCrawler) Name() string { +func (c *ActiveDirectoryHealthCrawler) Key() string { return "ACTIVEDIRECTORY_HEALTH" } diff --git a/crawler/health/cassandra/CassandraHealthCrawler.go b/crawler/health/cassandra/CassandraHealthCrawler.go index ce115e3..e920b97 100644 --- a/crawler/health/cassandra/CassandraHealthCrawler.go +++ b/crawler/health/cassandra/CassandraHealthCrawler.go @@ -11,7 +11,7 @@ type CassandraHealthCrawler struct { health.SocketHeahthCrawler } -func (c *CassandraHealthCrawler) Name() string { +func (c *CassandraHealthCrawler) Key() string { return "CASSANDRA_HEALTH" } diff --git a/crawler/health/dns/DNSHealthCrawler.go b/crawler/health/dns/DNSHealthCrawler.go index 945c7f0..24c6e83 100644 --- a/crawler/health/dns/DNSHealthCrawler.go +++ b/crawler/health/dns/DNSHealthCrawler.go @@ -11,7 +11,7 @@ type DNSHealthCrawler struct { health.SocketHeahthCrawler } -func (c *DNSHealthCrawler) Name() string { +func (c *DNSHealthCrawler) Key() string { return "DNS_HEALTH" } diff --git a/crawler/health/ftp/FTPHealthCrawler.go b/crawler/health/ftp/FTPHealthCrawler.go index 52baf22..2dcac62 100644 --- a/crawler/health/ftp/FTPHealthCrawler.go +++ b/crawler/health/ftp/FTPHealthCrawler.go @@ -11,7 +11,7 @@ type FTPHealthCrawler struct { health.SocketHeahthCrawler } -func (c *FTPHealthCrawler) Name() string { +func (c *FTPHealthCrawler) Key() string { return "FTP_HEALTH" } diff --git a/crawler/health/http/HTTPHealthCrawler.go b/crawler/health/http/HTTPHealthCrawler.go index a864c7a..bef3c70 100644 --- a/crawler/health/http/HTTPHealthCrawler.go +++ b/crawler/health/http/HTTPHealthCrawler.go @@ -11,7 +11,7 @@ type HTTPHealthCrawler struct { health.SocketHeahthCrawler } -func (c *HTTPHealthCrawler) Name() string { +func (c *HTTPHealthCrawler) Key() string { return "HTTP_HEALTH" } diff --git a/crawler/health/imap/IMAPHealthCrawler.go b/crawler/health/imap/IMAPHealthCrawler.go index 4ac075b..611790f 100644 --- a/crawler/health/imap/IMAPHealthCrawler.go +++ b/crawler/health/imap/IMAPHealthCrawler.go @@ -11,7 +11,7 @@ type IMAPHealthCrawler struct { health.SocketHeahthCrawler } -func (c *IMAPHealthCrawler) Name() string { +func (c *IMAPHealthCrawler) Key() string { return "IMAP_HEALTH" } diff --git a/crawler/health/ldap/LDAPHealthCrawler.go b/crawler/health/ldap/LDAPHealthCrawler.go index 7144ff8..ad359a8 100644 --- a/crawler/health/ldap/LDAPHealthCrawler.go +++ b/crawler/health/ldap/LDAPHealthCrawler.go @@ -11,7 +11,7 @@ type LDAPHealthCrawler struct { health.SocketHeahthCrawler } -func (c *LDAPHealthCrawler) Name() string { +func (c *LDAPHealthCrawler) Key() string { return "LDAP_HEALTH" } diff --git a/crawler/health/mongodb/MongoDBHealthCrawler.go b/crawler/health/mongodb/MongoDBHealthCrawler.go index 8c6fdfd..38a71eb 100644 --- a/crawler/health/mongodb/MongoDBHealthCrawler.go +++ b/crawler/health/mongodb/MongoDBHealthCrawler.go @@ -11,7 +11,7 @@ type MongoDBHealthCrawler struct { health.SocketHeahthCrawler } -func (c *MongoDBHealthCrawler) Name() string { +func (c *MongoDBHealthCrawler) Key() string { return "MONGODB_HEALTH" } diff --git a/crawler/health/mysql/MySQLHealthCrawler.go b/crawler/health/mysql/MySQLHealthCrawler.go index fa801cd..2c04c44 100644 --- a/crawler/health/mysql/MySQLHealthCrawler.go +++ b/crawler/health/mysql/MySQLHealthCrawler.go @@ -11,7 +11,7 @@ type MySQLHealthCrawler struct { health.SocketHeahthCrawler } -func (c *MySQLHealthCrawler) Name() string { +func (c *MySQLHealthCrawler) Key() string { return "MYSQL_HEALTH" } diff --git a/crawler/health/netbios/NetBIOSHealthCrawler.go b/crawler/health/netbios/NetBIOSHealthCrawler.go index 50535be..8ce2222 100644 --- a/crawler/health/netbios/NetBIOSHealthCrawler.go +++ b/crawler/health/netbios/NetBIOSHealthCrawler.go @@ -11,8 +11,8 @@ type NetBIOSHealthCrawler struct { health.SocketHeahthCrawler } -func (c *NetBIOSHealthCrawler) Name() string { - return "NETBIOS_HEALTH" +func (c *NetBIOSHealthCrawler) Key() string { + return "NBSS_HEALTH" } func (c *NetBIOSHealthCrawler) String() string { diff --git a/crawler/health/oracle/OracleHealthCrawler.go b/crawler/health/oracle/OracleHealthCrawler.go index b5f2535..619cd46 100644 --- a/crawler/health/oracle/OracleHealthCrawler.go +++ b/crawler/health/oracle/OracleHealthCrawler.go @@ -11,7 +11,7 @@ type OracleHealthCrawler struct { health.SocketHeahthCrawler } -func (c *OracleHealthCrawler) Name() string { +func (c *OracleHealthCrawler) Key() string { return "ORACLE_HEALTH" } diff --git a/crawler/health/pop/POPHealthCrawler.go b/crawler/health/pop/POPHealthCrawler.go index f6c51d2..a510ace 100644 --- a/crawler/health/pop/POPHealthCrawler.go +++ b/crawler/health/pop/POPHealthCrawler.go @@ -11,7 +11,7 @@ type POPHealthCrawler struct { health.SocketHeahthCrawler } -func (c *POPHealthCrawler) Name() string { +func (c *POPHealthCrawler) Key() string { return "POP_HEALTH" } diff --git a/crawler/health/postgresql/PostgreSQLHealthCrawler.go b/crawler/health/postgresql/PostgreSQLHealthCrawler.go index 7d6e767..1b70421 100644 --- a/crawler/health/postgresql/PostgreSQLHealthCrawler.go +++ b/crawler/health/postgresql/PostgreSQLHealthCrawler.go @@ -11,7 +11,7 @@ type PostgreSQLHealthCrawler struct { health.SocketHeahthCrawler } -func (c *PostgreSQLHealthCrawler) Name() string { +func (c *PostgreSQLHealthCrawler) Key() string { return "POSTGRESQL_HEALTH" } diff --git a/crawler/health/redis/RedisHealthCrawler.go b/crawler/health/redis/RedisHealthCrawler.go index 9731987..1645dd5 100644 --- a/crawler/health/redis/RedisHealthCrawler.go +++ b/crawler/health/redis/RedisHealthCrawler.go @@ -11,7 +11,7 @@ type RedisHealthCrawler struct { health.SocketHeahthCrawler } -func (c *RedisHealthCrawler) Name() string { +func (c *RedisHealthCrawler) Key() string { return "REDIS_HEALTH" } diff --git a/crawler/health/rmi/RMIHealthCrawler.go b/crawler/health/rmi/RMIHealthCrawler.go index 821f5a1..6c11ff2 100644 --- a/crawler/health/rmi/RMIHealthCrawler.go +++ b/crawler/health/rmi/RMIHealthCrawler.go @@ -11,7 +11,7 @@ type RMIHealthCrawler struct { health.SocketHeahthCrawler } -func (c *RMIHealthCrawler) Name() string { +func (c *RMIHealthCrawler) Key() string { return "RMI_HEALTH" } diff --git a/crawler/health/smb/SMBHealthCrawler.go b/crawler/health/smb/SMBHealthCrawler.go index 1c8e74f..0eaf315 100644 --- a/crawler/health/smb/SMBHealthCrawler.go +++ b/crawler/health/smb/SMBHealthCrawler.go @@ -11,7 +11,7 @@ type SMBHealthCrawler struct { health.SocketHeahthCrawler } -func (c *SMBHealthCrawler) Name() string { +func (c *SMBHealthCrawler) Key() string { return "SMB_HEALTH" } diff --git a/crawler/health/smtp/SMTPHealthCrawler.go b/crawler/health/smtp/SMTPHealthCrawler.go index e16c80a..5023df9 100644 --- a/crawler/health/smtp/SMTPHealthCrawler.go +++ b/crawler/health/smtp/SMTPHealthCrawler.go @@ -11,7 +11,7 @@ type SMTPHealthCrawler struct { health.SocketHeahthCrawler } -func (c *SMTPHealthCrawler) Name() string { +func (c *SMTPHealthCrawler) Key() string { return "SMTP_HEALTH" } diff --git a/crawler/health/snmp/v2/SNMPHealthCrawler.go b/crawler/health/snmp/v2/SNMPHealthCrawler.go index 1b3a0ae..4e32a4a 100644 --- a/crawler/health/snmp/v2/SNMPHealthCrawler.go +++ b/crawler/health/snmp/v2/SNMPHealthCrawler.go @@ -11,7 +11,7 @@ type SNMPHealthCrawler struct { health.SocketHeahthCrawler } -func (c *SNMPHealthCrawler) Name() string { +func (c *SNMPHealthCrawler) Key() string { return "SNMPV2C_HEALTH" } diff --git a/crawler/health/snmp/v3/SNMPHealthCrawler.go b/crawler/health/snmp/v3/SNMPHealthCrawler.go index a81a33f..0cc9845 100644 --- a/crawler/health/snmp/v3/SNMPHealthCrawler.go +++ b/crawler/health/snmp/v3/SNMPHealthCrawler.go @@ -11,7 +11,7 @@ type SNMPHealthCrawler struct { health.SocketHeahthCrawler } -func (c *SNMPHealthCrawler) Name() string { +func (c *SNMPHealthCrawler) Key() string { return "SNMPV3_HEALTH" } diff --git a/crawler/health/sqlserver/SQLServerHealthCrawler.go b/crawler/health/sqlserver/SQLServerHealthCrawler.go index a93ba9a..fd7a095 100644 --- a/crawler/health/sqlserver/SQLServerHealthCrawler.go +++ b/crawler/health/sqlserver/SQLServerHealthCrawler.go @@ -11,7 +11,7 @@ type SQLServerHealthCrawler struct { health.SocketHeahthCrawler } -func (c *SQLServerHealthCrawler) Name() string { +func (c *SQLServerHealthCrawler) Key() string { return "SQLSERVER_HEALTH" } diff --git a/crawler/health/ssh/SSHHealthCrawler.go b/crawler/health/ssh/SSHHealthCrawler.go index 826d198..d5a5260 100644 --- a/crawler/health/ssh/SSHHealthCrawler.go +++ b/crawler/health/ssh/SSHHealthCrawler.go @@ -11,7 +11,7 @@ type SSHHealthCrawler struct { health.SocketHeahthCrawler } -func (c *SSHHealthCrawler) Name() string { +func (c *SSHHealthCrawler) Key() string { return "SSH_HEALTH" } diff --git a/crawler/health/telnet/TelnetHealthCrawler.go b/crawler/health/telnet/TelnetHealthCrawler.go index eae9e92..d860ab1 100644 --- a/crawler/health/telnet/TelnetHealthCrawler.go +++ b/crawler/health/telnet/TelnetHealthCrawler.go @@ -11,7 +11,7 @@ type TelnetHealthCrawler struct { health.SocketHeahthCrawler } -func (c *TelnetHealthCrawler) Name() string { +func (c *TelnetHealthCrawler) Key() string { return "TELNET_HEALTH" } diff --git a/crawler/health/wmi/WMIHealthCrawler.go b/crawler/health/wmi/WMIHealthCrawler.go index a210452..7e3e189 100644 --- a/crawler/health/wmi/WMIHealthCrawler.go +++ b/crawler/health/wmi/WMIHealthCrawler.go @@ -11,7 +11,7 @@ type WMIHealthCrawler struct { health.SocketHeahthCrawler } -func (c *WMIHealthCrawler) Name() string { +func (c *WMIHealthCrawler) Key() string { return "WMI_HEALTH" } diff --git a/crawler/ssh/SSHCrawler.go b/crawler/ssh/SSHCrawler.go index fa1c412..c0114a0 100644 --- a/crawler/ssh/SSHCrawler.go +++ b/crawler/ssh/SSHCrawler.go @@ -17,7 +17,7 @@ type SSHCrawler struct { crawler.Crawler } -func (c *SSHCrawler) Name() string { +func (c *SSHCrawler) Key() string { return "SSH" } diff --git a/crawler/ssh/parser/cpu_parser.go b/crawler/ssh/parser/cpu_parser.go index 1e69600..0c56e63 100644 --- a/crawler/ssh/parser/cpu_parser.go +++ b/crawler/ssh/parser/cpu_parser.go @@ -8,7 +8,7 @@ import ( type CPUParser struct { } -func (p *CPUParser) Name() string { +func (p *CPUParser) Key() string { return "cpu" } diff --git a/crawler/ssh/parser/memory_parser.go b/crawler/ssh/parser/memory_parser.go index 6f21b9e..12928ef 100644 --- a/crawler/ssh/parser/memory_parser.go +++ b/crawler/ssh/parser/memory_parser.go @@ -7,7 +7,7 @@ import ( type MemoryParser struct { } -func (p *MemoryParser) Name() string { +func (p *MemoryParser) Key() string { return "mem" } diff --git a/crawler/ssh/parser/parser.go b/crawler/ssh/parser/parser.go index 540acb7..9e4790a 100644 --- a/crawler/ssh/parser/parser.go +++ b/crawler/ssh/parser/parser.go @@ -12,7 +12,7 @@ func init() { } func addParser(p Parser) { - parsers[p.Name()] = p + parsers[p.Key()] = p } func GetParser(name string) Parser { @@ -24,7 +24,7 @@ func GetParser(name string) Parser { } type Parser interface { - Name() string + Key() string Parse(scanner *ParserScanner) (map[string]string, error) }