(imported topic written by cstoneba)
Is there an inspector for the TEM client that returns a random integer? i want to use the “restart x” command, but have “x” be a random number between 0 - 300.
Any suggestions?
thanks
(imported topic written by cstoneba)
Is there an inspector for the TEM client that returns a random integer? i want to use the “restart x” command, but have “x” be a random number between 0 - 300.
Any suggestions?
thanks
(imported comment written by Lee Wei)
There is not a random inspector that I know of.
I wonder if the following might work for you.
Take the Second off the current time, then multiply by 5. That should always give you a number between 0 - 300.
{ (it as integer * 5) of second_of_minute of time (local time zone) of now }
Lee Wei
(imported comment written by cstoneba)
Hi Lee, that sounds like a good idea, but my only concern is if our servers all have very close times synced with our NTP servers, targets with the same time will get the same “random” number, and then we’re not resolving anything.
(imported comment written by NoahSalzman)
How about something like this:
q:
((
if
it
<
300
then
it
else
(
it
mod
300
))
of
(last
3
of
((handle count
of
process
"System"
free space
of
drive
"c:"
second_of_minute
of
time (local time zone)
of
now
/
(last
3
of
(sum
of
kernel times
of
processes
as
string))
as
integer)
as
string)
as
integer))
|
222
A:
273
T:
2.554 ms
I:
singular integer
The 222 is there in case any of those process inspectors fail to return a value. You will definitely want to test this in your environment to see how random the values are. If you keep seeing 222 then you got a problem, clearly.
You can pick and choose which “system environment variables” are most random in your set of machines… but things like process inspectors, memory, and disk space are obvious choices.
(imported comment written by cstoneba)
thanks Noah. That’ll work, but I’ll have to put in an enhancement request for so that this can be done nativley in the client.
(imported comment written by NoahSalzman)
Let me know if it works.
FWIW, we have a bug that tracks the request for an inspector that generates pseudorandom numbers (#59220). If you log an RFE please reference that bug number as the RFE system is separate from the BigFix Team’s defect tracking system.