Help Getting Chocolatey for Automate Going

This forum is for the discussions and support for the Chocolatey For Automate plugin. Inside you will find the Documentation Project forum that describes the operation of the plugin.
User avatar
Cubert
Posts: 2457
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Help Getting Chocolatey for Automate Going

Post by Cubert »

Code: Select all

net use %locationdrive% /user:%cacheuser% @mycachepass@
In all scripts we reference "%locationdrive%". This variable is auto generated by Automate when any agent runs script and "should" be a direct representation of the agents "location" drive settings for that Location.


Image


Each location will have its own set of locations and drive credentials. If agent is not generating this information in the script then there is a problem with Automate. Make sure you can verify that the agent in questions current location falls with-in the configured parameters as see above.

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

Re: Help Getting Chocolatey for Automate Going

Post by Cubert »

Sorry, I miss read your last post. You are asking about "LTSVCDIR" variable not location drive variable. My confusion, but the same process stands. LTSVCDIR is a system and script variable that should be pre filled out for every agent that runs scripts.

This however is not uncommon and we have seen this issue before. Some script functions take the variable just fine where others may not.

The work around is to either simply replace variable with "c:\windows\ltsvc\" where ever its called or create a test at the top of script that tests for that location and if present set variable to that location.

This is how ever a Automate scripting issue and not a misuse of the variable or typo.

PL-MSTech
Posts: 47
Joined: Mon Jul 31, 2023 10:07 pm

Re: Help Getting Chocolatey for Automate Going

Post by PL-MSTech »

Apparently %ltsvcdir% is only functional in scripts and inside the automate environment (unless you add it manually or by script to the windows environment), but I have verified that it works by opening the machines in automate, then a command prompt for the machine and 'echo %ltsvcdir%' - they all echo back C:\Windows\LTSvc.

The %locationdrive% %cacheuser% (and password) is good... So the variables in automate are not the issue... still, chocolatey is not installing managed apps to the clients... I manually told the plugin to install apps from cache repo yesterday just to the caching server, but again today... all the other machines have blank managed applications windows.

This is the script result from 1 machine from the most recent run:

9/21/23 05:06:26
The agent did not return any application data, exiting script.

RESULT 05:06:27:
The Script(6210) was successful in the Else section.

Script: S6210 - Starting at Server Time: Thursday, September 21, 2023 5:06:04 AM
IF F5 ValueOne (P1): MYCMD Comparer (P2): 2 ValueTwo (P3): AGENTSYNC T: 0.2385264
L2 F117 Sql (P1): 'SELECT count(*) as `Suspended` FROM `plugin_p4a_chocolatey_clients` WHERE ClientID = '1' a...' T: 0.2541856
L3 F31 Control (P1): 1 T: 0.3090318
L4 F20 SetType(P1):1 Parameter(P2):'C:\ProgramData\chocolatey\choc...' VariableName(P3):CHOCOEXE T: 12.4404512
L5 F90 File (P1): %ltsvcdir%\Chocolatey\GetPKGVersion.ps1 T: 12.4546003
L6 F70 Value (P1): MYCMD Comparer (P2): 2 To (P3): INSTALLCHOCO Jump (P4): :INSTALLCHOCO T: 18.5874232
L7 F70 Value (P1): MYCMD Comparer (P2): 2 To (P3): UPDATECACHE Jump (P4): :UPDATECACHE T: 18.5874232
L8 F70 Value (P1): MYCMD Comparer (P2): 2 To (P3): MASTERVERSION Jump (P4): :MASTERVERSION T: 18.5874232
L9 F70 Value (P1): MYCMD Comparer (P2): 2 To (P3): VERSIONING Jump (P4): :VERSIONING T: 18.5874232
L98 F139 Note (P1): :VERSIONING T: 18.5874232
L99 F154 Folder (P1): %ltsvcdir%\Chocolatey T: 18.5951416
L100 F20 SetType(P1):1 Parameter(P2):1 VariableName(P3):LOOPCOUNT T: 22.6504848
L101 F196 SQL (P1): 'SELECT a.AppAssocID, b.RepoName FROM plugin_p4a_chocolatey_agent_apps a LEFT JOIN `plugin...' T: 22.6504848
L102 F70 Value (P1): 0 Comparer (P2): 2 To (P3): 0 Jump (P4): :NOSQLDATASET T: 22.6504848
L192 F139 Note (P1): :NOSQLDATASET T: 22.6504848
L193 F29 Message (P1): The agent did not return any application data, exiting script. T: 22.6504848
L194 F129 Jump (P1): T: 22.6504848

PL-MSTech
Posts: 47
Joined: Mon Jul 31, 2023 10:07 pm

Re: Help Getting Chocolatey for Automate Going

Post by PL-MSTech »

Looks to me like it is jumping there from Line
134: (IF %sqldatasetrowcount% = 0 THEN Jump to :NOSQLDATASET)
the line before that is:
133: (SQL Get DataSet) SELECT ID, RepoName FROM `plugin_p4a_chocolatey_applications`

If I run that command in Automate Database Commander, I get:
sqqlerror.png
sqqlerror.png (29.51 KiB) Viewed 61745 times

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

Re: Help Getting Chocolatey for Automate Going

Post by Cubert »

Didn't want you to think I was ignoring you, I am looking into this.

My problem is that the original 3.0 was meant to work against a pre determined list based on software matches found in installed software. C4A 3.5 is trying to breach the gap between that way of doing things and what is expected with a plugin set to interoperate with chocolatey.
Let me look over things in code base and see if we need to make a larger change to how operations are done. I am contemplating a rewrite based more on our latest works.

I'll post again tomorrow what I going to do.

PL-MSTech
Posts: 47
Joined: Mon Jul 31, 2023 10:07 pm

Re: Help Getting Chocolatey for Automate Going

Post by PL-MSTech »

Thanks... and just FYI, I am not sure if you are on the MSPGeek Slack channel any longer, but the advise SOME of them give is to avoid C4A due to:
- It’s very limited in configuration, typically you end up making every agent a standalone agent
- The P4A scripts also have a nasty configuration in all of them that they don’t rely on searches, groups, etc. they blast the script against all agents on 1 hour intervals for some of the plugins. The script then determines if it’s applicable or not.
^^ Which makes me think that since it is setup for the scripts to be "blasted against all agents in 1 hour intervals" (or even if it is 2hr intervals)... this seems like it can get VERY resource intensive against our agents AND our Automate server.
So I would suggest the ability to DEFINE the interval... maybe more often for machines that are not yet considered 'up to date' -- and less often for ones that are.

And the reliance on the Automate Sync service doesn't seem efficient at all... I should be able to test on one small location/site immediately to ensure everything is working.

Anyhow... I am willing to hang in there with you to see how this shakes out... hopefully we can get it functional and efficient.

Thank you for your perseverance!

PL-MSTech
Posts: 47
Joined: Mon Jul 31, 2023 10:07 pm

Re: Help Getting Chocolatey for Automate Going

Post by PL-MSTech »

Any updates?

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

Re: Help Getting Chocolatey for Automate Going

Post by Cubert »

Yes sir, working on some significant updates. I'll have some thing shortly.

PL-MSTech
Posts: 47
Joined: Mon Jul 31, 2023 10:07 pm

Re: Help Getting Chocolatey for Automate Going

Post by PL-MSTech »

Can you see the replies I sent for your 2 PMs?
I expected them to go to "Sent Messages" but they are still in "Outbox"

PL-MSTech
Posts: 47
Joined: Mon Jul 31, 2023 10:07 pm

Re: Help Getting Chocolatey for Automate Going

Post by PL-MSTech »

Any progress on this, Sir?

Locked

Return to “Chocolatey For Automate”