marge: 合并11.2版本
This commit is contained in:
@@ -44,12 +44,46 @@ type YamlConfig struct {
|
||||
ListenAddr string `yaml:"listenAddr"`
|
||||
ListenPort uint16 `yaml:"listenPort"`
|
||||
PrivateKey string `yaml:"privateKey"`
|
||||
MaxConnNum uint8 `yaml:"maxConnNum"`
|
||||
MaxConnNum int `yaml:"maxConnNum"`
|
||||
Timeout uint16 `yaml:"timeout"`
|
||||
Session string `yaml:"session"`
|
||||
MmlHome string `yaml:"mmlHome"`
|
||||
UserName string `yaml:"userName"`
|
||||
Password string `yaml:"password"`
|
||||
AuthType string `yaml:"authType"`
|
||||
TagNE string `yaml:"tagNE"`
|
||||
} `yaml:"sshd"`
|
||||
|
||||
TelnetServer struct {
|
||||
ListenAddr string `yaml:"listenAddr"`
|
||||
ListenPort uint16 `yaml:"listenPort"`
|
||||
MaxConnNum int `yaml:"maxConnNum"`
|
||||
Timeout uint16 `yaml:"timeout"`
|
||||
Session string `yaml:"session"`
|
||||
MmlHome string `yaml:"mmlHome"`
|
||||
UserName string `yaml:"userName"`
|
||||
Password string `yaml:"password"`
|
||||
AuthType string `yaml:"authType"`
|
||||
TagNE string `yaml:"tagNE"`
|
||||
} `yaml:"telnetServer"`
|
||||
|
||||
SNMPServer struct {
|
||||
ListenAddr string `yaml:"listenAddr"`
|
||||
ListenPort uint16 `yaml:"listenPort"`
|
||||
UserName string `yaml:"userName"`
|
||||
AuthPass string `yaml:"authPass"`
|
||||
AuthProto string `yaml:"authProto"`
|
||||
PrivPass string `yaml:"privPass"`
|
||||
PrivProto string `yaml:"privProto"`
|
||||
EngineID string `yaml:"engineID"`
|
||||
TrapPort uint16 `yaml:"trapPort"`
|
||||
TrapListen bool `yaml:"trapListen"`
|
||||
TrapBool bool `yaml:"trapBool"`
|
||||
TrapTick uint16 `yaml:"trapTick"`
|
||||
TimeOut uint16 `yaml:"timeOut"`
|
||||
TrapTarget string `yaml:"trapTarget"`
|
||||
} `yaml:"snmpServer"`
|
||||
|
||||
Database DbConfig `yaml:"database"`
|
||||
|
||||
OMC struct {
|
||||
@@ -133,14 +167,16 @@ const DefaultConfigFile = "./etc/sshsvc.yaml"
|
||||
func init() {
|
||||
cfile := flag.String("c", DefaultConfigFile, "config file")
|
||||
pv := flag.Bool("v", false, "print version")
|
||||
pversion := flag.Bool("version", false, "print version")
|
||||
ph := flag.Bool("h", false, "print help")
|
||||
phelp := flag.Bool("help", false, "print help")
|
||||
|
||||
flag.Parse()
|
||||
if *pv {
|
||||
if *pv || *pversion {
|
||||
fmt.Printf("OMC sshsvc version: %s\n%s\n%s\n\n", global.Version, global.BuildTime, global.GoVer)
|
||||
os.Exit(0)
|
||||
}
|
||||
if *ph {
|
||||
if *ph || *phelp {
|
||||
flag.Usage()
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user