Ad Widget

Collapse

Add 'nowait' flag for User Paramters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BrentN
    Member
    • Mar 2012
    • 37

    #1

    Add 'nowait' flag for User Paramters

    Until agent traffic is more secure, I'm going to have to disable use of 'system.run' for items. This presents a problem because that is how I was triggering my script which checks for Windows Updates which then sends the script output back using the sender to another item. Because the script takes a while to run, my existing item looks like this:

    Code:
    system.run[powershell.exe -NoLogo -NonInteractive -File "%ZabbixRoot%\scripts\WindowsUpdates.ps1",nowait]
    This worked great. Now, I need to move that command into a user parameter, however, I don't see a way to tell the agent to not wait for the command to execute so the item becomes not supported. I already have my command timeout set to 20 seconds for some other commands and 30 is the max (and 20 is already pretty high). The update check script can take minutes to run.

    Is there a way to tell the command for a UserParamater to 'nowait'? If not, this would be very useful.
  • timbo
    Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2013
    • 50

    #2
    Hi BrentN,

    Did you sort this out?

    If you're using the Zabbix Sender in your powershell script, then you don't need to trigger it via the Zabbix Agent, have you considered using Windows Task Scheduler (Scheduled Tasks in XP)? I almost exclusively use Task Scheduler for my Zabbix Trapper scripts.

    If you must use the Zabbix Agent, could you call a batch/VB script that can execute the powershell script with a "nowait" flag, then exit itself immediately? This would allow your powershell script to run for as long as it needs to, and because the script that executed it closed, the Zabbix Agent would be freed up to continue.

    Hope this helps.

    -Timbo

    Comment

    Working...