Triggering Command Polling

Hi Pros

I am using command polling to manage my internet clients
command polling is set to run in every 30 minutes for now but I want to add an action in offering list;

so users can trigger command polling manually when they need.

Is there any action script command or client api command to apply this?

Probably you are looking for an not end open offer.

But why would you allow the users to launch the polling?
I could bring lot of issues related to performance.

Hello

When I create a task or any other content on console, it is annoying to wait 30 minutes to see the results.
I dont want to use “notify client forcerefresh” because it is too heavy.
I want the besclient to get only new contents from server or relay.

This is not equivalent to command polling. I’m not even sure that issuing it to a client would actually cause it to poll for commands. It tells the client to send a full report with all property and applicability results.

You can address this by opening up UDP on port 52311 on all of you clients and firewalls to your relays. It won’t solve all cases, but it will help with many of them. In some cases you might want to put some relays behind WAN connections to help with both bandwidth but also with UDP notifications. You mention this happens with your clients connected over the internet, and in most cases there isn’t much you can do about that.

As far as I know there isn’t an API that can be easily triggered to tell the client that it should do command polling right now. There also isn’t an actionscript command. I have been asking for both of these things for various reasons for a long time now. CC: @AlanM

One option that I have been thinking about is to have an offer that would set the command polling interval to 10 minutes, then have a policy action automatically set it back to a less aggressive value after the next successful poll for commands. I would generally recommend something in the once every 3 hour range for all clients and once an hour for those that commonly communicate over the internet. (generally WiFi devices)

This is the best option I can think of as a way to trigger command polling.

Related:

1 Like

all clients are mobile in this environment (it is a SaaS model of bigfix). so I can’t use udp ping because all clients are in internet.

the option “changing polling period” seems OK.
but there is a question here.
Does besclient require a restart to apply new polling value ?

if not, firstly, I will try to update polling setting with old value. I hope this update resets its timer and I dont need a policy action to set it to default :
setting "_BESClient_Comm_CommandPollIntervalSeconds"="1800" on "{now}" for client

secondly I am trying to set a different value.
setting "_BESClient_Comm_CommandPollIntervalSeconds"="600" on "{now}" for client

I am not certain, but I don’t think so as long as the new setting is set through the actionscript settings commands. (policy or offer)

If you edit the registry directly, even in actionscript, then the client should not see the new settings until it is restarted. I would avoid restarting the client just for command polling if possible. Not an ideal way to do it, though it would work to trigger a command poll.

That is an interesting thought. I don’t think it would work this way, but who knows, it might. Can’t be certain without trying it.

The option that I’m fairly certain would work is setting it to once every 10 minutes, then flipping it back to the default with a policy action, but another thing to try would be to set it to 1 minute in the action script, then immediately set it back to the default of 30min or whatever.

If there are many clients in the same location / office, then it may make sense to designate a relay there.

It doesn’t seem like simply changing the command polling interval value has an effect. The client should be comparing the command polling value to an internal timer or a value that represents the last time it polled for commands, so it makes sense that setting the interval wouldn’t have an effect.

I do wonder what would happen if you disable then immediately reenable command polling in the actionscript. That might work.

I just tried this, and it didn’t seem to work:

setting "_BESClient_Comm_CommandPollEnable"="0" on "{now}" for client

parameter "start" = "{now}"
pause while{ now - (it as time) of (parameter "start") < 2 * second }

setting "_BESClient_Comm_CommandPollEnable"="1" on "{now}" for client

It seems like it should.

It could be that the action needs to end for the setting change to really take effect.

That doesn’t seem to work either. I set the command polling interval to once every 12 hours on my test machine. I created a policy action to enable command polling on all of my systems, which already had it enabled. I then created an offer to disable command polling. I triggered the offer which disabled command polling, then after a delay the policy action to enable command polling triggered automatically, reenabling it. This did not seem to trigger a command polling event in the log.

setting to just same value works for me


At 23:26:51 +0300 - 
   ActionLogMessage: (action:503) Action signature verified for Execution
   ActionLogMessage: (action:503) starting action
At 23:26:51 +0300 - actionsite (http://*:52311/cgi-bin/bfgather.exe/actionsite)
   Command succeeded setting "_BESClient_Comm_CommandPollIntervalSeconds"="1800" on "Thu, 08 Dec 2016 23:26:51 +0300" for client (action:503)
At 23:26:51 +0300 - 
   ActionLogMessage: (action:503) ending action
At 23:26:51 +0300 - mailboxsite (http://*:52311/cgi-bin/bfgather.exe/mailboxsite16496948)
   Not Relevant - poll deneme (fixlet:503)
At 23:26:52 +0300 - BES Support (http://sync.bigfix.com/cgi-bin/bfgather/bessupport)
   Relevant - BES Clients using Main BES Server instead of BES Relay - Manual Selection (Primary BES Relay Set) (fixlet:136)
At 23:27:01 +0300 - 
   PollForCommands: Requesting commands
   PollForCommands: commands to process: 1
   Successful Synchronization with site 'actionsite' (version 922) - 'http://*:52311/cgi-bin/bfgather.exe/actionsite'
   Successful Synchronization with site 'mailboxsite' (version 41) - 'http://*:52311/cgi-bin/bfgather.exe/mailboxsite16496948'
   [ThreadTime:23:27:01] ShutdownListener
   [ThreadTime:23:27:01] SetupListener success: IPV4/6
At 23:28:04 +0300 - 
   Encrypted Report posted successfully
At 23:29:51 +0300 - 
   Encrypted Full Report posted successfully
At 23:30:03 +0300 - BES Support (http://sync.bigfix.com/cgi-bin/bfgather/bessupport)
   Fixed - BES Clients using Main BES Server instead of BES Relay - Manual Selection (Primary BES Relay Set) (fixlet:136)

It is hard to tell if that worked, or if it would have happened anyway at that time. I’ll have to do some more testing, but it doesn’t seem like it worked for me.

Setting the polling interval to 12 hours multiple times didn’t seem to trigger command polling.

Setting it to a slightly lower value also didn’t trigger command polling.

Disabling and reenabling command polling didn’t seem to trigger command polling.

I can’t seem to get anything to work. I’m testing on client v9.5.0.311

CC: @AlanM

I am trying again and I will post the results here soon
:confused:
It didnt work for my second test

1 Like

Setting the command polling interval to something rather short, then back to the normal setting does seem to work for me.

One problem is that you can’t easily tell when the last command polling time was using relevance to know when to set it back to default.

1 Like

A solution I thought of is that you can set command polling to something like 5 or 10 minutes, then set it back to default after 5 or 10 minutes goes by. You can tell when the setting was changed using the relevance for effective date

https://developer.bigfix.com/relevance/reference/setting.html#effective-date-of-setting-time

1 Like

In my limited testing I have found that this action command causes a force-syncronization with all fixlet sites:

enable gathering

On my test device my client syncs with all fixlet sites within 5 seconds of running the command.

3 Likes

great :slight_smile:

does this command have the same affect with command polling ?

I’m not sure what else command polling does and how this differs.

It does however look like it will do what you are looking for.

1 Like

this is a solution which I can not find anywhere, because there is not such a command in action script guide
thanks very much

1 Like

where did you find this?

it sounds like this command forces a gather which would be more aggressive than command polling. Command polling is effectively checking to see if a gather is needed, while this sounds like it forces a gather check across all sites.

I didn’t know about this command, but it appears in this PDF from 2003: http://support.bigfix.com/fixlet/documents/WinActions-2003-05-27.pdf

I’ve been looking for a solution like this for years.

Related:

1 Like