Page 3 of 4

Re: Habitat Announce Maintenance Tool

Posted: Wed May 31, 2023 12:33 pm
by chris10385
Cubert wrote: Tue May 30, 2023 5:13 pm Also lets look at the name your using.

Patch Install - Test Workstations (DoD)

Try modifying the SQL QUERY to look for name "LIKE" and see if you maybe get a different name. I.E an extra space or some char that was unexpected.

Code: Select all

SELECT a.ComputerID, b.day, b.starttime, b.CustomAction  FROM v_dv_patchgroupassignment a 
LEFT JOIN installsoftwarepolicies b on a.PatchingGroupInstallPolicy = b.Name 
WHERE PatchingGroupName LIKE '%Workstations%(DoD)%'  
and ComputerID IN (Select a.ComputerID FROM computers a 
WHERE a.LastContact > date_add(now(),interval -5 minute) and a.OS LIKE '%Windows%' 
and a.OS NOT LIKE '%Server%' and a.ClientID IN (SELECT ID FROM extrafielddata 
WHERE ExtraFieldID = (SELECT ID FROM extrafield WHERE `Name` = 'Enable Habitat Announce Maintenance') 
and `Value` = '1'))
Changing the query to look for LIKE returned results.
hab sql 3.png
hab sql 3.png (31.47 KiB) Viewed 47160 times

Re: Habitat Announce Maintenance Tool

Posted: Wed May 31, 2023 2:21 pm
by Cubert
Problem # 1 Day = 8

When day = 8 this means in Automate "EveryDay". 0-7 is Sunday - Saturday and 8 represents every day.


Problem #2 Patch Group Name does not match Name

Your names are mismatched so you are also failing this test.


So first thing to fix is why day is not showing a date from 0-7
Screenshot 2023-05-31 101742.png
Screenshot 2023-05-31 101742.png (129.87 KiB) Viewed 47152 times

Not sure why name would be different from name listed here?

Screenshot 2023-05-31 102007.png
Screenshot 2023-05-31 102007.png (45.14 KiB) Viewed 47152 times

Re: Habitat Announce Maintenance Tool

Posted: Wed May 31, 2023 2:32 pm
by Cubert
We made a new name change to group and successfully query agent list afterwards. So We need to look further into why your name is not the same from point to point.
Screenshot 2023-05-31 102529.png
Screenshot 2023-05-31 102529.png (54.97 KiB) Viewed 47151 times

We can make some modifications to the query to look for 8 as a day, I will need to look at how Automate manages dates outside of Day Of Week. So I am not to concerned about the day issue.

Re: Habitat Announce Maintenance Tool

Posted: Fri Jun 02, 2023 1:20 pm
by chris10385
Ok so it appears for this SQL query to return data I had to change the update policy to specifically run on Friday (today). It does not like when I use the custom option and choose second, third, fourth friday. Which would definitely create a little more manual work and changing the policies for our three groups monthly. Waiting to see if I get the notice at 10am.

Re: Habitat Announce Maintenance Tool

Posted: Fri Jun 02, 2023 4:56 pm
by chris10385
Welp no announcement went out still. But all of the sql queries are returning the correct data.

Re: Habitat Announce Maintenance Tool

Posted: Mon Jun 05, 2023 12:53 pm
by Cubert
Ok now lets look at an agents script logs? Did the script get scheduled? If so, When did it get scheduled? and what was the output of the script? (error/ succeed) and any script logs.

Lets also check your scripts version as we did update script with latest build.


The script looks for user to be logged into console. If so, it should then send a pop up yes/no box with your message. If they select yes we log that they acknowledged message.

The script is pretty basic, It looks for a console user, if no user it exits as no one to announce to...

If user is on console then it jumps to SQL query to get you message from database. We verify we have a message record then jump to sending the message. We take data from the query (Title and Message) and we bind that to a variable and then using a built in Automate script function we pop open a question box with a yes/no button with your message and title assigned. We then test to see if user clicks yes or no and we log that click.

Screenshot 2023-06-05 084704.png
Screenshot 2023-06-05 084704.png (51.47 KiB) Viewed 47088 times



If you look over script we log at every jump and during messaging so the agent script logs should have at least one log from script in it. Can you post those logs so we can see where in script it stopped?

Re: Habitat Announce Maintenance Tool

Posted: Mon Jun 05, 2023 2:00 pm
by chris10385
Ok so it appears that it scheduled the script for 13 computers on Saturday at 1230pm. It should have went out on Friday (day 6) at that time. Script is version 1.0.1.34.

Re: Habitat Announce Maintenance Tool

Posted: Mon Jun 05, 2023 2:15 pm
by Cubert
Can you confirm that this is still the accurate settings for your config? I>E you have same day selected?

Image

Re: Habitat Announce Maintenance Tool

Posted: Mon Jun 05, 2023 2:34 pm
by chris10385
Yes it is still set for same day. Only other thing I changed was the group name to take out the parenthesis around DoD. Maybe Friday is day 5 not 6?

Re: Habitat Announce Maintenance Tool

Posted: Mon Jun 05, 2023 3:37 pm
by Cubert
Yeap after a little more investigating

Visual Studios used DayOfWeek in a 0-6 format and Of course Automate uses 1-7 format. We needed to add a 1 to it along with a if >7 revert back to 1.

Build 1.0.1.35 will have this fix in it. Allow me a few hours to get it posted up.