Habitat Announce Maintenance Tool

Detailed descriptions and imagery explaining each tool available inside Habitat. Feel free to post feature requests under each tools forum post if you would like to see something added or changed in the tools.
chris10385
Posts: 19
Joined: Tue May 23, 2023 4:10 pm

Re: Habitat Announce Maintenance Tool

Post 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 46695 times

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat Announce Maintenance Tool

Post 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 46687 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 46687 times

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat Announce Maintenance Tool

Post 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 46686 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.

chris10385
Posts: 19
Joined: Tue May 23, 2023 4:10 pm

Re: Habitat Announce Maintenance Tool

Post 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.
Attachments
ms update 1.png
ms update 1.png (50.99 KiB) Viewed 46666 times
ms update 2.png
ms update 2.png (39.56 KiB) Viewed 46666 times
hab sql 4.png
hab sql 4.png (165.53 KiB) Viewed 46666 times

chris10385
Posts: 19
Joined: Tue May 23, 2023 4:10 pm

Re: Habitat Announce Maintenance Tool

Post by chris10385 »

Welp no announcement went out still. But all of the sql queries are returning the correct data.

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat Announce Maintenance Tool

Post 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 46623 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?

chris10385
Posts: 19
Joined: Tue May 23, 2023 4:10 pm

Re: Habitat Announce Maintenance Tool

Post 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.
Attachments
hab ann maint sched script.png
hab ann maint sched script.png (205.82 KiB) Viewed 46619 times
hab ann maint sched script 2.png
hab ann maint sched script 2.png (513.31 KiB) Viewed 46619 times

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat Announce Maintenance Tool

Post by Cubert »

Can you confirm that this is still the accurate settings for your config? I>E you have same day selected?

Image

chris10385
Posts: 19
Joined: Tue May 23, 2023 4:10 pm

Re: Habitat Announce Maintenance Tool

Post 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?
Attachments
hab message.png
hab message.png (134.69 KiB) Viewed 46614 times

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat Announce Maintenance Tool

Post 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.

Post Reply

Return to “Habitat Documentation Forum”