Documentation
¶
Overview ¶
Package https allows the implementation of TLS.
Index ¶
- Constants
- Variables
- func BackupConfig(srcDir string, targetDir string, filename string) error
- func CheckDirectory(path string) (bool, error)
- func CheckFile(path string) (bool, error)
- func CheckProcess(pid int, keyword string) bool
- func CheckProcessExist(pid int, keyword string) bool
- func CopyFile(srcPath, targetPath string) error
- func GetCurrentTime(sec int, dateFormat DateFormat) string
- func GetHostname() (string, error)
- func GetHostnameAlias(hostName string) (string, error)
- func GetParentAbsPath(inPath string, parentLevel int) (string, error)
- func GetParentPath(inPath string, parentLevel int) string
- func GetTimeString(dateFormat DateFormat, t time.Time) string
- func InitCommandMessages()
- func KillProcess(pid int, keyword string) bool
- func Listen(server *http.Server, config *Config) error
- func MakeContext(timeout int) (context.Context, context.CancelFunc)
- func MakeTLSConfig(c *Config, clientAuth string) (*tls.Config, error)
- func MakeTLSConfigClientAuth(c *Config) (*tls.Config, error)
- func MakeTLSConfigServerAuth(c *Config) (*tls.Config, error)
- func PrintUsage() error
- func ReadFileHead(filename string, maxRow int) ([]string, error)
- func Run(ctx context.Context, argv []string, stdout, stderr io.Writer) error
- func RunAdmin(ctx context.Context, argv []string, stdout, stderr io.Writer) error
- func RunNettest(ctx context.Context, argv []string, stdout, stderr io.Writer) error
- func RunSender(ctx context.Context, argv []string, stdout, stderr io.Writer) error
- func SetLog(home string) error
- func SetLogLevel(level int) error
- func Translate(acceptLanguage string, msg string, args ...interface{}) string
- func TrimPathSeparator(path string) string
- func Unzip(src, dest string) error
- func Usage(msgs *[]string)
- func VersionMessage() string
- func Zip(zipPath, outDir, logPath string) error
- type Collector
- type CommandInfo
- func (c *CommandInfo) ExecCommandNoRedirect() error
- func (c *CommandInfo) ExecCommandNoRedirectWithContext(ctx context.Context) error
- func (c *CommandInfo) ExecCommandRedirect() error
- func (c *CommandInfo) ExecCommandRedirectWithContext(ctx context.Context) error
- func (c *CommandInfo) PeriodicLoopCommand(ctx context.Context, cycle, step int) error
- type Config
- func (config *Config) ArchiveData(task *Task, datastore *Datastore) error
- func (config *Config) AuthLicense(expire int) error
- func (config *Config) CheckConfig() error
- func (config *Config) CheckDiskUtil() error
- func (config *Config) CheckExitFile() (string, error)
- func (config *Config) CheckHAStatus() error
- func (config *Config) CheckHostname(hostname string) bool
- func (config *Config) CheckLicense(expired int) error
- func (config Config) CheckPathInHome(path string) (bool, error)
- func (config *Config) CheckServiceExist(pid int) bool
- func (config Config) CheckWorkFile(filename string) (bool, error)
- func (config *Config) DownloadLicense() error
- func (config Config) GetArchivefilePath(filename string) string
- func (config *Config) GetCollector(statName string) *Collector
- func (config *Config) GetServiceOrHostName() string
- func (config Config) GetWorkfilePath(filename string) string
- func (c *Config) InitAgent() error
- func (config *Config) LoadLicense() error
- func (c *Config) NewDatastore(statName string, start time.Time) (*Datastore, error)
- func (c *Config) NewDatastoreCurrent(statName string) (*Datastore, error)
- func (config *Config) ParseConfigDir(configDir string)
- func (config *Config) ParseConfigFile(configFile string)
- func (config *Config) ParseConfigLine(line string)
- func (config *Config) PostTask(task *Task)
- func (config *Config) PrepareCollector(c *Collector) error
- func (config *Config) PurgeData(task *Task, datastore *Datastore) error
- func (config Config) ReadPid() (int, error)
- func (config Config) ReadWorkFile(filename string) ([]string, error)
- func (config Config) ReadWorkFileHead(filename string, maxRow int) ([]string, error)
- func (config Config) ReadWorkFileNumber(filename string) (int, error)
- func (config Config) RemoveArchiveFile(filename string) error
- func (config Config) RemoveWorkFile(filename string) error
- func (config *Config) Run() error
- func (c *Config) RunDaemon()
- func (config *Config) RunFileTransfer(sendEnable bool, zipFile string) error
- func (config *Config) RunFileTransferDownloadLicense() error
- func (config *Config) RunSetup(siteKey, password, urlCM string) error
- func (config *Config) RunSetupConsole(siteKey, password, url string) error
- func (config *Config) RunTask(c *Collector, count int, tasks chan<- *Task)
- func (config *Config) RunWebService(ctx context.Context)
- func (config *Config) RunWithContext(ctx context.Context) error
- func (config *Config) SaveReport(task *Task, datastore *Datastore) error
- func (config *Config) SendCollectorData(zip string) error
- func (config *Config) SendCollectorDataAll(datastore *Datastore) error
- func (config *Config) SendCollectorDataInternal(zip string) error
- func (config *Config) SetupHttpProxy() error
- func (config *Config) Stop() error
- func (config *Config) StopDaemon() error
- func (config *Config) TruncateBackupData(task *Task, datastore *Datastore) error
- func (config *Config) UnzipSSLConf() error
- func (config *Config) WindowsServiceControl(command string) error
- func (config Config) WriteLineWorkFile(filename, line string) error
- func (config Config) WriteWorkFile(filename string, lines []string) error
- func (config Config) WriteWorkFileNumber(filename string, num int) error
- type ConfigEnv
- type Datastore
- func (o *Datastore) AbsDir() string
- func (ds *Datastore) GetDatastoreSets() (*[]DatastoreSet, error)
- func (ds *Datastore) GetZipFiles(since string) ([]string, error)
- func (ds *Datastore) LatestZip() (string, error)
- func (o *Datastore) OldZipFile(host string, hour int) string
- func (ds *Datastore) OldestZip(since string) (string, error)
- func (o *Datastore) RelDir() string
- func (o *Datastore) ZipFile(host string) string
- func (o *Datastore) ZipFilePrefix(host string) string
- type DatastoreKey
- type DatastoreSet
- type DateFormat
- type DiskStatus
- type JSONTime
- type Job
- type License
- type ParamMode
- type ParamType
- type ProcMode
- type ReportTask
- type ReportTaskJob
- type ReportTaskTime
- type Response
- type Schedule
- func (schedule *Schedule) AddCollector(collector *Collector)
- func (schedule *Schedule) FindOrCreateCollector(statName string) *Collector
- func (schedule *Schedule) GetCollector(statName string) *Collector
- func (schedule *Schedule) ParseConfigDir(configDir string) error
- func (schedule *Schedule) ParseConfigFile(configFile string) error
- func (schedule *Schedule) ParseConfigLine(line string)
- type SoapSender
- func (soapSender *SoapSender) CheckHostStatus(siteKey, hostname, accessKey string) (string, error)
- func (soapSender *SoapSender) DownloadCertificate(siteKey, hostname, timestamp, netConfigPath string) (string, error)
- func (soapSender *SoapSender) DownloadConfigFilePM(filename string) error
- func (soapSender *SoapSender) DownloadUpdateModule(moduleTag, majorVer, build, downloadPath string) (string, error)
- func (soapSender *SoapSender) GetLatestBuild(moduleTag string, majorVer string) (string, error)
- func (soapSender *SoapSender) MakeSoapRequest(requestMsg string) (*http.Request, error)
- func (sender *SoapSender) MakeSoapRequestMsg(action string, requests map[string]string) (string, error)
- func (soapSender *SoapSender) MakeSoapRequestWithAttachment(requestMsg string, filePath string) (*http.Request, error)
- func (soapSender *SoapSender) MakeTransportWithClientAuthSSL(c *Config) (*http.Transport, error)
- func (soapSender *SoapSender) MakeTransportWithServerAuthSSL(c *Config) (*http.Transport, error)
- func (soapSender *SoapSender) RegistAgent(siteKey, hostname, accessKey, netConfigPath string) (string, error)
- func (soapSender *SoapSender) ReserveFileSender(onOff string, waitSec int) error
- func (soapSender *SoapSender) ReserveSender(siteKey string, filename string) error
- func (soapSender *SoapSender) SendData(siteKey, filename, zipPath string) (string, error)
- func (soapSender *SoapSender) SendMessage(siteKey, hostname, severity, message string) (string, error)
- func (soapSender *SoapSender) SendZipData(filename string) error
- func (sender *SoapSender) WithAttachedFilePath(filePath string) *SoapSender
- func (sender *SoapSender) WithTimeout(timeout int) *SoapSender
- type Task
- type TaskJob
- type WebService
- func (h *WebService) DownloadDatastoreZip(w http.ResponseWriter, r *http.Request)
- func (h *WebService) DownloadDatastoreZipTemp(w http.ResponseWriter, r *http.Request)
- func (h *WebService) FindDatastoreZip(vars map[string]string) (string, error)
- func (h *WebService) GetLatestDatastoreSets(w http.ResponseWriter, r *http.Request)
- func (h *WebService) NewDatastore(node, job string) *Datastore
- func (h *WebService) ServHttp(ctx context.Context) error
- func (h *WebService) Upload(w http.ResponseWriter, r *http.Request)
Constants ¶
const ( DEFAULT_DISK_CAPACITY int = 10 DEFAULT_SAVE_HOUR = 3 DEFAULT_RECOVERY_HOUR = 3 DEFAULT_MAX_ERROR_LOG = 10 DEFAULT_COMMAND_TIMEOUT = 86400 LIMIT_MAX_ERROR_LOG = 10000 DEFAULT_PROXY_PORT = 8080 DEFAULT_LOG_LEVEL = 3 DEFAULT_LOG_SIZE = 100000 DEFAULT_LOG_ROTATION = 5 DEFAULT_SOAP_RETRY = 3 DEFAULT_SOAP_TIMEOUT = 30 CHECK_LICENSE_INTERVAL = 10 POLLER_INTERVAL = 60 )
Default set fo getperf.ini
const ClientAuth = "RequireAndVerifyClientCert"
const DEFAULT_SERVICE_URL = "http://0.0.0.0:59000"
const HelpMessage = `` /* 447-byte string literal not displayed */
const Version = "2.19.0"
Variables ¶
var Revision = "HEAD"
var SoapRequestMsgTemplates map[string]string = map[string]string{
"getLatestBuild": `
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:ns0="http://perf.getperf.com">
<soapenv:Header>
<wsa:Action>urn:getLatestBuild</wsa:Action>
<wsa:MessageID>urn:uuid:{{ .MessageID }}</wsa:MessageID>
<wsa:To>{{ .ToURL }}</wsa:To>
</soapenv:Header>
<soapenv:Body>
<ns0:getLatestBuild xmlns:ns0="http://perf.getperf.com" xmlns="http://rmi.java/xsd">
<ns0:moduleTag>{{ .moduleTag }}</ns0:moduleTag>
<ns0:majorVer>{{ .majorVer }}</ns0:majorVer>
</ns0:getLatestBuild xmlns:ns0="http://perf.getperf.com">
</soapenv:Body>
</soapenv:Envelope>
`,
"downloadCertificate": `
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:ns0="http://perf.getperf.com">
<soapenv:Header>
<wsa:Action>urn:downloadCertificate</wsa:Action>
<wsa:MessageID>urn:uuid:{{ .MessageID }}</wsa:MessageID>
<wsa:To>{{ .ToURL }}</wsa:To>
</soapenv:Header>
<soapenv:Body>
<ns0:downloadCertificate xmlns:ns0="http://perf.getperf.com" xmlns="http://rmi.java/xsd">
<ns0:siteKey>{{ .siteKey }}</ns0:siteKey>
<ns0:hostname>{{ .hostname }}</ns0:hostname>
<ns0:timestamp>{{ .timestamp }}</ns0:timestamp>
</ns0:downloadCertificate xmlns:ns0="http://perf.getperf.com">
</soapenv:Body>
</soapenv:Envelope>
`,
"checkAgent": `
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:ns0="http://perf.getperf.com">
<soapenv:Header>
<wsa:MessageID>urn:uuid:{{ .MessageID }}</wsa:MessageID>
<wsa:To>{{ .ToURL }}</wsa:To>
<wsa:Action>urn:checkAgent</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<checkAgent xmlns="http://perf.getperf.com">
<siteKey>{{ .siteKey }}</siteKey>
<hostname>{{ .hostname }}</hostname>
<accessKey>{{ .accessKey }}</accessKey>
</checkAgent>
</soapenv:Body>
</soapenv:Envelope>
`,
"getLatestVersion": `
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:ns0="http://perf.getperf.com">
<soapenv:Header>
<wsa:MessageID>urn:uuid:{{ .MessageID }}</wsa:MessageID>
<wsa:To>{{ .ToURL }}</wsa:To>
<wsa:Action>urn:getLatestVersion</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<getLatestVersion xmlns="http://perf.getperf.com">
</getLatestVersion>
</soapenv:Body>
</soapenv:Envelope>
`,
"registAgent": `
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:ns0="http://perf.getperf.com">
<soapenv:Header>
<wsa:MessageID>urn:uuid:{{ .MessageID }}</wsa:MessageID>
<wsa:To>{{ .ToURL }}</wsa:To>
<wsa:Action>urn:registAgent</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<registAgent xmlns="http://perf.getperf.com">
<siteKey>{{ .siteKey }}</siteKey>
<hostname>{{ .hostname }}</hostname>
<accessKey>{{ .accessKey }}</accessKey>
</registAgent>
</soapenv:Body>
</soapenv:Envelope>
`,
"sendMessage": `
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Action>urn:sendMessage</wsa:Action>
<wsa:MessageID>urn:uuid:{{ .MessageID }}</wsa:MessageID>
<wsa:To>{{ .ToURL }}</wsa:To>
</soap-env:Header>
<soap-env:Body>
<ns0:sendMessage xmlns:ns0="http://perf.getperf.com">
<ns0:siteKey>{{ .siteKey }}</ns0:siteKey>
<ns0:hostname>{{ .hostname }}</ns0:hostname>
<ns0:severity>{{ .severity }}</ns0:severity>
<ns0:message>{{ .message }}</ns0:message>
</ns0:sendMessage>
</soap-env:Body>
</soap-env:Envelope>
`,
"sendData": `
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Action>urn:sendData</wsa:Action>
<wsa:MessageID>urn:uuid:{{ .MessageID }}</wsa:MessageID>
<wsa:To>{{ .ToURL }}</wsa:To>
</soap-env:Header>
<soap-env:Body>
<ns0:sendData xmlns:ns0="http://perf.getperf.com">
<ns0:siteKey>{{ .siteKey }}</ns0:siteKey>
<ns0:filename>{{ .filename }}</ns0:filename>
</ns0:sendData>
</soap-env:Body>
</soap-env:Envelope>
`,
"reserveSender": `
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Action>urn:reserveSender</wsa:Action>
<wsa:MessageID>urn:uuid:{{ .MessageID }}</wsa:MessageID>
<wsa:To>{{ .ToURL }}</wsa:To>
</soap-env:Header>
<soap-env:Body>
<ns0:reserveSender xmlns:ns0="http://perf.getperf.com">
<ns0:siteKey>{{ .siteKey }}</ns0:siteKey>
<ns0:filename>{{ .filename }}</ns0:filename>
<ns0:size>{{ .size }}</ns0:size>
</ns0:reserveSender>
</soap-env:Body>
</soap-env:Envelope>
`,
"downloadUpdateModule": `
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Action>urn:downloadUpdateModule</wsa:Action>
<wsa:MessageID>urn:uuid:{{ .MessageID }}</wsa:MessageID>
<wsa:To>{{ .ToURL }}</wsa:To>
</soap-env:Header>
<soap-env:Body>
<ns0:downloadUpdateModule xmlns:ns0="http://perf.getperf.com">
<ns0:moduleTag>{{ .moduleTag }}</ns0:moduleTag>
<ns0:majorVer>{{ .majorVer }}</ns0:majorVer>
<ns0:build>{{ .build }}</ns0:build>
</ns0:downloadUpdateModule>
</soap-env:Body>
</soap-env:Envelope>
`,
}
テンプレート
Functions ¶
func BackupConfig ¶
BackupConfig は構成ファイルのバックアップをします。
func CheckDirectory ¶
CheckDirectory はディレクトリの存在確認をします。
func CheckProcessExist ¶
func GetCurrentTime ¶
func GetCurrentTime(sec int, dateFormat DateFormat) string
GetCurrentTime は指定したフォーマット形式で何秒前の現在時刻を取得します。
func GetHostnameAlias ¶
GetHostnameAlias はホスト名の「.」以降の文字列はカットし、大文字は小文字に変換します。
func GetParentAbsPath ¶
GetParentPathAbs は実行パスから上位のディレクトリを絶対パスに変換して返します。
func GetParentPath ¶
GetParentPathAbs は実行パスから上位のディレクトリを絶対パスに変換して返します。
func GetTimeString ¶
func GetTimeString(dateFormat DateFormat, t time.Time) string
gpfDGetTimeString は指定したフォーマット形式で時刻を変換します。
GPF_DATE_FORMAT_DEFAULT 0 GPF_DATE_FORMAT_YYYYMMDD 1 GPF_DATE_FORMAT_HHMISS 2 GPF_DATE_FORMAT_YYYYMMDD_HHMISS 3 GPF_DATE_FORMAT_DIR 4
func InitCommandMessages ¶
func InitCommandMessages()
func KillProcess ¶
func Listen ¶
Listen starts the server on the given address. If tlsConfigPath isn't empty the server connection will be started using TLS.
func MakeContext ¶
func MakeContext(timeout int) (context.Context, context.CancelFunc)
func PrintUsage ¶
func PrintUsage() error
func ReadFileHead ¶
ReadFile はファイルを指定した行数分読み込みます。
func RunNettest ¶
func SetLogLevel ¶
; Log level. None 0, FATAL 1, CRIT 2, ERR 3, WARN 4, NOTICE 5, INFO 6, DBG 7 LOG_LEVEL = 5
func TrimPathSeparator ¶
TrimPathSeparator はパス名(/tmp/log/data/)から前後のセパレータを 取り除きます(tmp/log/data)
func VersionMessage ¶
func VersionMessage() string
Types ¶
type Collector ¶
type Collector struct { Id int /**< primary key(sequence) */ StatName string /**< Metric */ Status string StatEnable bool /**< Enabled */ Build int /**< Build version */ StatStdoutLog bool /**< Standard output flag */ StatInterval int /**< Interval(sec) */ StatTimeout int /**< Timeout(sec) */ NextTimestamp time.Time StatMode string /**< Stataus mode */ Jobs []*Job /**< First job */ }
func NewCollector ¶
type CommandInfo ¶
type CommandInfo struct { CmdLine string OutPath string Timeout int Executed bool Pid int ExitCode int Status string OutBuf string }
func (*CommandInfo) ExecCommandNoRedirect ¶
func (c *CommandInfo) ExecCommandNoRedirect() error
func (*CommandInfo) ExecCommandNoRedirectWithContext ¶
func (c *CommandInfo) ExecCommandNoRedirectWithContext(ctx context.Context) error
func (*CommandInfo) ExecCommandRedirect ¶
func (c *CommandInfo) ExecCommandRedirect() error
func (*CommandInfo) ExecCommandRedirectWithContext ¶
func (c *CommandInfo) ExecCommandRedirectWithContext(ctx context.Context) error
func (*CommandInfo) PeriodicLoopCommand ¶
func (c *CommandInfo) PeriodicLoopCommand(ctx context.Context, cycle, step int) error
type Config ¶
type Config struct { Module int // Module id(S:Scheduler, C:Collector, W:Worker) ElapseTime int // Elapsed time(sec) StartTime time.Time // Start time(UTC) Mode ProcMode // Status(INIT, WAIT, RUN, ...) ManagedPid int // Scheduler process id LocaleFlag int // Localization flag(0:English, 1:Japanese) DaemonFlag int // Daemon flag Host string // Hostname(Convert to lowercase , except the domain part) ServiceName string // HA service name Pwd string // Current directory Home string // Home directory ParameterFile string // Parameter file ProgramName string // Program name ProgramPath string // Program path OutDir string // Metric collection directory WorkDir string // Work directory WorkCommonDir string // Common work directory ArchiveDir string // Archive directory BackupDir string // Backup directory ScriptDir string // Script directory BinDir string // Binary directory LogDir string // Application log directory SslDir string // SSL manage directory CacertFile string // CA cert file ClcertFile string // Client cert file ClkeyFile string // Bind file of client cert and key SvParamFile string // Server parameter file SvcertFile string // Server cert file SvkeyFile string // Server key file SvcacertFile string // Inter CA cert file LicenseFile string // License file SoapRetry int // WEB service retry count ExitFlag string // Exit flag file PidFile string // PID file PidPath string // PID absolute path // CollectorPids map[int]int // Collector pids SslConfig *soap.SSLConfig // struct GPFSSLConfig_t *sslConfig; // SSL manager // logConfig *LogConfig // struct GPFLogConfig_t *logConfig; // Log manager Schedule *Schedule // struct GPFSchedule_t *schedule; // Scheduler }
func (*Config) ArchiveData ¶
ArchiveDataは、指定したタスクのログに対して zip 圧縮をします。 * arc_{host}__{stat}_{date}_{time}.zip ファイル名作成を作成します。 * {stat}/{date}/{time} ディレクトリパスを作成します。 * ログ保存ディレクトリ(ODir)に移動します。 * 次のコマンドと同じ zip 圧縮。zip -r arcxxx.zip ODIR
func (*Config) AuthLicense ¶
func (*Config) CheckConfig ¶
func (*Config) CheckDiskUtil ¶
func (*Config) CheckExitFile ¶
func (*Config) CheckHAStatus ¶
func (*Config) CheckHostname ¶
func (*Config) CheckLicense ¶
CheckLicense はライセンスファイルをダウンロードし、ライセンスをチェックします
func (Config) CheckPathInHome ¶
CheckPathInHome はパスがホーム下を指定しているか、".."が含まれないかをチェックします。
func (*Config) CheckServiceExist ¶
func (Config) CheckWorkFile ¶
CheckWorkFile はワークファイルの確認の有無を確認します。
func (*Config) DownloadLicense ¶
func (Config) GetArchivefilePath ¶
func (*Config) GetCollector ¶
func (*Config) GetServiceOrHostName ¶
func (Config) GetWorkfilePath ¶
GetWorkfilePath はファイル名が'_'で始まる場合は共有ディレクトリ下のパスを、 そうでない場合はローカルディレクトリ下のパスを返します。
func (*Config) LoadLicense ¶
func (*Config) NewDatastore ¶
func (*Config) NewDatastoreCurrent ¶
func (*Config) ParseConfigDir ¶
func (*Config) ParseConfigFile ¶
func (*Config) ParseConfigLine ¶
func (*Config) PrepareCollector ¶
func (Config) ReadWorkFile ¶
ReadWorkFile はワークファイルを全行読み込みます。
func (Config) ReadWorkFileHead ¶
ReadWorkFile はワークファイルを指定した行数分読み込みます。
func (Config) ReadWorkFileNumber ¶
ReadWorkFileNumber はワークファイルから数値を読み込みます。
func (Config) RemoveArchiveFile ¶
func (Config) RemoveWorkFile ¶
RemoveWorkFile はワークファイルの削除をします。
func (*Config) RunFileTransfer ¶
func (*Config) RunFileTransferDownloadLicense ¶
func (*Config) RunSetupConsole ¶
func (*Config) RunWebService ¶
func (*Config) SaveReport ¶
func (*Config) SendCollectorData ¶
func (*Config) SendCollectorDataAll ¶
func (*Config) SendCollectorDataInternal ¶
func (*Config) SetupHttpProxy ¶
func (*Config) StopDaemon ¶
func (*Config) TruncateBackupData ¶
func (*Config) UnzipSSLConf ¶
func (*Config) WindowsServiceControl ¶
func (Config) WriteLineWorkFile ¶
func (Config) WriteWorkFile ¶
WriteWorkFile はークファイルの書き込みをします。
type ConfigEnv ¶
type ConfigEnv struct {
// contains filtered or unexported fields
}
func NewConfigEnvBase ¶
type Datastore ¶
type Datastore struct { StartTime time.Time Host string StatName string DateDir string TimeDir string OutDir string }
func NewDatastoreBase ¶
func (*Datastore) GetDatastoreSets ¶
func (ds *Datastore) GetDatastoreSets() (*[]DatastoreSet, error)
func (*Datastore) ZipFilePrefix ¶
type DatastoreKey ¶
type DatastoreSet ¶
type DatastoreSet struct { DsKey DatastoreKey `json:"keys"` ZipFile string }
type DateFormat ¶
type DateFormat int
const ( DEFAULT DateFormat = iota YYYYMMDD HHMISS YYYYMMDD_HHMISS DIR )
type DiskStatus ¶
type DiskStatus struct { All uint64 `json:"all"` Used uint64 `json:"used"` Free uint64 `json:"free"` }
func CheckDiskFree ¶
func CheckDiskFree(dir string) (DiskStatus, error)
CheckDiskFree は指定したディレクトリのディスク使用量[%]を取得します。
type JSONTime ¶
func (JSONTime) MarshalJSON ¶
type Job ¶
type License ¶
func NewLicense ¶
func NewLicense() *License
type ReportTask ¶
type ReportTask struct { Schedule ReportTaskTime Jobs []ReportTaskJob }
type ReportTaskJob ¶
type Schedule ¶
type Schedule struct { DiskCapacity int /**< Disk free threshold(%) */ SaveHour int /**< Metric data retention(H) */ RecoveryHour int /**< Metric data retransmission(H) */ MaxErrorLog int /**< Max rows of error output */ Pid int /**< Scheduler process id */ Status int /**< Process status */ LogLevel int /**< Log level */ DebugConsole bool /**< Console log enabled */ LogSize int /**< Log size */ LogRotation int /**< Number of log rotation */ LogLocalize bool /**< Flag of Japanese log */ HanodeEnable bool /**< HA node check flag */ HanodeCmd string /**< HA node check script */ PostEnable bool /**< Post command enabled */ PostCmd string /**< Post command */ PostSoapCmdType string /**< Post SOAP command type */ RemhostEnable bool /**< Remote transfer enabled */ UrlCM string /**< Web service URL (Configuration manager) */ UrlPM string /**< Web service URL (Performance manager) */ SoapTimeout int /**< Web service timeout */ SiteKey string /**< Site key */ Password string /**< Password */ WebServiceEnable bool // Web service enable WebServiceUrl string // Web service url ProxyEnable bool /**< HTTP proxy enabled */ ProxyHost string /**< Proxy host */ ProxyPort int /**< Proxy port */ LastUpdate time.Time /**< Last update of parameter file */ ParseFailed bool /**< Set true if parser failed */ License *License Collectors map[string]*Collector // Collector pids }
func NewSchedule ¶
func NewSchedule() *Schedule
func (*Schedule) AddCollector ¶
func (*Schedule) FindOrCreateCollector ¶
func (*Schedule) GetCollector ¶
func (*Schedule) ParseConfigDir ¶
func (*Schedule) ParseConfigFile ¶
func (*Schedule) ParseConfigLine ¶
type SoapSender ¶
type SoapSender struct { ServerIP string MessageID string ServiceURL string Transport *http.Transport AttachedFilePath string Timeout int }
func NewSoapSender ¶
func NewSoapSender(serverIp string, port int) (*SoapSender, error)
func (*SoapSender) CheckHostStatus ¶
func (soapSender *SoapSender) CheckHostStatus(siteKey, hostname, accessKey string) (string, error)
TODO 引数に GPFSetupConfig *setup を追加
func (*SoapSender) DownloadCertificate ¶
func (soapSender *SoapSender) DownloadCertificate(siteKey, hostname, timestamp, netConfigPath string) (string, error)
func (*SoapSender) DownloadConfigFilePM ¶
func (soapSender *SoapSender) DownloadConfigFilePM(filename string) error
func (*SoapSender) DownloadUpdateModule ¶
func (soapSender *SoapSender) DownloadUpdateModule(moduleTag, majorVer, build, downloadPath string) (string, error)
func (*SoapSender) GetLatestBuild ¶
func (soapSender *SoapSender) GetLatestBuild(moduleTag string, majorVer string) (string, error)
func (*SoapSender) MakeSoapRequest ¶
func (soapSender *SoapSender) MakeSoapRequest(requestMsg string) (*http.Request, error)
func (*SoapSender) MakeSoapRequestMsg ¶
func (*SoapSender) MakeSoapRequestWithAttachment ¶
func (*SoapSender) MakeTransportWithClientAuthSSL ¶
func (soapSender *SoapSender) MakeTransportWithClientAuthSSL(c *Config) (*http.Transport, error)
func (*SoapSender) MakeTransportWithServerAuthSSL ¶
func (soapSender *SoapSender) MakeTransportWithServerAuthSSL(c *Config) (*http.Transport, error)
func (*SoapSender) RegistAgent ¶
func (soapSender *SoapSender) RegistAgent(siteKey, hostname, accessKey, netConfigPath string) (string, error)
func (*SoapSender) ReserveFileSender ¶
func (soapSender *SoapSender) ReserveFileSender(onOff string, waitSec int) error
func (*SoapSender) ReserveSender ¶
func (soapSender *SoapSender) ReserveSender(siteKey string, filename string) error
func (*SoapSender) SendData ¶
func (soapSender *SoapSender) SendData(siteKey, filename, zipPath string) (string, error)
func (*SoapSender) SendMessage ¶
func (soapSender *SoapSender) SendMessage(siteKey, hostname, severity, message string) (string, error)
func (*SoapSender) SendZipData ¶
func (soapSender *SoapSender) SendZipData(filename string) error
func (*SoapSender) WithAttachedFilePath ¶
func (sender *SoapSender) WithAttachedFilePath(filePath string) *SoapSender
func (*SoapSender) WithTimeout ¶
func (sender *SoapSender) WithTimeout(timeout int) *SoapSender
type Task ¶
type Task struct { Collector *Collector Datastore *Datastore Pid int /**< Collector process id */ Status ProcMode /**< Process status */ StatTimeout int // StartTime time.Time /**< Start time(UTC) */ StartTime time.Time /**< Start time(UTC) */ EndTime time.Time /**< End time(UTC) */ // DateDir string /**< Date directory */ // TimeDir string /**< Time directory */ Odir string /**< Output directory */ ScriptDir string /**< Script directory */ TaskJobs []*TaskJob }
func (*Task) MakeReport ¶
func (*Task) MakeReportTaskJobs ¶
func (t *Task) MakeReportTaskJobs() []ReportTaskJob
type TaskJob ¶
type TaskJob struct { Job *Job Seq int Timeout int MaxRow int Odir string ScriptDir string CmdLine string LoopCount int CommandInfo *CommandInfo Status ProcMode StartTime time.Time EndTime time.Time }
func (*TaskJob) Run ¶
func (taskJob *TaskJob) Run() (*CommandInfo, error)
func (*TaskJob) RunWithContext ¶
func (taskJob *TaskJob) RunWithContext(ctx context.Context) (*CommandInfo, error)
type WebService ¶
func NewWebService ¶
func NewWebService(cfg *Config) (*WebService, error)
func NewWebServiceBase ¶
func NewWebServiceBase(url string, archiveDir string, cfg *Config) *WebService
func (*WebService) DownloadDatastoreZip ¶
func (h *WebService) DownloadDatastoreZip(w http.ResponseWriter, r *http.Request)
func (*WebService) DownloadDatastoreZipTemp ¶
func (h *WebService) DownloadDatastoreZipTemp(w http.ResponseWriter, r *http.Request)
func (*WebService) FindDatastoreZip ¶
func (h *WebService) FindDatastoreZip(vars map[string]string) (string, error)
func (*WebService) GetLatestDatastoreSets ¶
func (h *WebService) GetLatestDatastoreSets(w http.ResponseWriter, r *http.Request)
func (*WebService) NewDatastore ¶
func (h *WebService) NewDatastore(node, job string) *Datastore
func (*WebService) Upload ¶
func (h *WebService) Upload(w http.ResponseWriter, r *http.Request)
Source Files
¶
- admin.go
- agent.go
- cmd_msgs.go
- collector.go
- common.go
- config.go
- daemon.go
- datastore.go
- diskusage.go
- getperf2.go
- https.go
- license.go
- log.go
- nettestmain.go
- param.go
- process.go
- process_unix.go
- processutil.go
- proxy.go
- schedule.go
- service.go
- setup.go
- soap.go
- soap_agent.go
- soap_file_exchange.go
- soap_msgs.go
- soap_ssl.go
- task.go
- taskjob.go
- taskreport.go
- version.go
- webservice.go
- worker.go
- workfile.go
- zip.go