Hello,
I have created two UserParameter for w32:
1)
UserParameter=actlogin,"C:\Program Files\zabbix\actlogin.bat"
It works right. No problem.
2)
UserParameter=username,cscript "C:\Program Files\zabbix\username.vbs" //nologo
This vbs doesn´t work right. When I create the key (username) in the server I get Parameter usename is not supported. Any idea???
This is the test script:
------
option explicit
dim net, rrr
set net = createobject("wscript.network")
rrr = "User: " & net.username
set net = nothing
wscript.echo rrr
------
and this the zabbix_agentd.conf file (both script and configuration file are in the same directory):
Server=192.168.201.35
# Server port for sending active checks
ServerPort=10051
# Unique hostname. Required for active checks.
Hostname=exchange
# Listen port. Default is 10050
ListenPort=10050
# IP address to bind agent
# If missing, bind to all available IPs
#ListenIP=192.168.201.45
# Number of pre-forked instances of zabbix_agentd.
# Default value is 5
# This parameter must be between 1 and 16
StartAgents=5
# How often refresh list of active checks. 2 minutes by default.
#RefreshActiveChecks=120
# Disable active checks. The agent will work in passive mode listening server.
#DisableActive=1
# Specifies debug level
# 0 - debug is not created
# 1 - critical information
# 2 - error information
# 3 - warnings (default)
# 4 - for debugging (produces lots of information)
DebugLevel=3
# Name of PID file
#PidFile=C:\Program Files/zabbix/zabbix_agentd.pid
# Name of log file.
# If not set, syslog will be used
LogFile=C:\Program Files/zabbix/zabbix_agentd.log
# Spend no more than Timeout seconds on processing
# Must be between 1 and 30
Timeout=3
##### Experimental options. Use with care ! #####
# Get rid of sockets in TIME_WAIT state
# This will set socket option SO_LINGER
# NoTimeWait=1
##### End of experimental options
####### USER-DEFINED MONITORED PARAMETERS #######
# Format: "UserParameter='key','shell command'"
# Note that shell command must not return empty string or EOL only
#UserParameter=mysql.version,mysql -V
UserParameter=actlogin,"C:\Program Files\zabbix\actlogin.bat"
UserParameter=username,cscript "C:\Program Files\zabbix\username.vbs" //nologo
#UserParameter=login,cscript //NoLogo c:\diskspace.vbs $1
Thank you.
I have created two UserParameter for w32:
1)
UserParameter=actlogin,"C:\Program Files\zabbix\actlogin.bat"
It works right. No problem.
2)
UserParameter=username,cscript "C:\Program Files\zabbix\username.vbs" //nologo
This vbs doesn´t work right. When I create the key (username) in the server I get Parameter usename is not supported. Any idea???
This is the test script:
------
option explicit
dim net, rrr
set net = createobject("wscript.network")
rrr = "User: " & net.username
set net = nothing
wscript.echo rrr
------
and this the zabbix_agentd.conf file (both script and configuration file are in the same directory):
Server=192.168.201.35
# Server port for sending active checks
ServerPort=10051
# Unique hostname. Required for active checks.
Hostname=exchange
# Listen port. Default is 10050
ListenPort=10050
# IP address to bind agent
# If missing, bind to all available IPs
#ListenIP=192.168.201.45
# Number of pre-forked instances of zabbix_agentd.
# Default value is 5
# This parameter must be between 1 and 16
StartAgents=5
# How often refresh list of active checks. 2 minutes by default.
#RefreshActiveChecks=120
# Disable active checks. The agent will work in passive mode listening server.
#DisableActive=1
# Specifies debug level
# 0 - debug is not created
# 1 - critical information
# 2 - error information
# 3 - warnings (default)
# 4 - for debugging (produces lots of information)
DebugLevel=3
# Name of PID file
#PidFile=C:\Program Files/zabbix/zabbix_agentd.pid
# Name of log file.
# If not set, syslog will be used
LogFile=C:\Program Files/zabbix/zabbix_agentd.log
# Spend no more than Timeout seconds on processing
# Must be between 1 and 30
Timeout=3
##### Experimental options. Use with care ! #####
# Get rid of sockets in TIME_WAIT state
# This will set socket option SO_LINGER
# NoTimeWait=1
##### End of experimental options
####### USER-DEFINED MONITORED PARAMETERS #######
# Format: "UserParameter='key','shell command'"
# Note that shell command must not return empty string or EOL only
#UserParameter=mysql.version,mysql -V
UserParameter=actlogin,"C:\Program Files\zabbix\actlogin.bat"
UserParameter=username,cscript "C:\Program Files\zabbix\username.vbs" //nologo
#UserParameter=login,cscript //NoLogo c:\diskspace.vbs $1
Thank you.
Comment