Habitat Linux Update Manager shows no Updates

Support forums for the Habitat Automate plugin
Post Reply
frankbe
Posts: 11
Joined: Thu Jun 13, 2019 2:48 pm
4

Habitat Linux Update Manager shows no Updates

Post by frankbe »

Hello
i posted this already, maybe in the wrong forum.


The Habitat Linux Update Manager shows no Updates in the List window:

http://support.plugins4labtech.com/view ... 8841#p8841

Can I have support for this issue ?

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

Re: Habitat Linux Update Manager shows no Updates

Post by Cubert »

Yeap, You in the correct forums for Habitat Tools.

Lets see what we can do for you.

I haven't personally done a Debian agent myself but should be similar to Ubuntu, using Apt-Get as its package manager.



If you open the SQL analyzer in Habitat and execute (with the checkbox checked to return data) the following. Replace the Your ID here with the agent ID of the Linux box in question.
SELECT * FROM plugin_p4a_habitat_lum_status WHERE ComputerID = 'Your ID Here';
and
SELECT * FROM plugin_p4a_habitat_lum_packages WHERE ComputerID = 'Your ID Here';
To see if they spit out any package data.

If you get status data but no package data then these updates maybe considered optional or feature updates and may not be included in package view.

The "Habitat LUM Maintenance Service" manages the collection of packages available on each agent. When the Automation calls for Update scans it calls a function in this script that starts a "list packages available for update" scan and imports that data into Automate. The view you posted should display those packages.

The script uses a small Python script to query Apt-Get for the package data and package counts. You can see this script being scheduled on you Debian agent daily. By following the script logs and the commands executed by script in the commands log you can see what was sent to agent and what agent returned. If the data is missing here then the agent is not reporting these packages. If the data appears in the database but not in plugin then we have something broken and I'll need to look at the code base to see what might be going on.

frankbe
Posts: 11
Joined: Thu Jun 13, 2019 2:48 pm
4

Re: Habitat Linux Update Manager shows no Updates

Post by frankbe »

Hi,

the first query returns the total_updates
the second query on the same Computer is empty

The Script is LUM maintenance Service

Can i start the script with debug ? What is the first variable mycmd ?

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

Re: Habitat Linux Update Manager shows no Updates

Post by Cubert »

the MYCMD variable is used by Habitat to control what parts of the script get run. Its a means to select functions out of the script instead of running each and every line.

So if MYCMD = UPGRADE then it run the entire Then statement section. If MYCMD = anything else it goes to the else section where we test it further to see if it equals a given command value. In this case we are looking for SCAN, if it is set as MYCMD then we will seek out the scan function in the else statement and execute till the next exit script function.

Capture.PNG
Capture.PNG (32.34 KiB) Viewed 1731 times

This allows us to have 1 script but many functions we can call.

You do not need debug, what you need is to view the script and command output logs in the agent console for the time stamps that the script is running. The script should log some data and the executing commands on agent will log the commands return so you can see the raw output from any command execution.

Sounds like it is not getting package list back correctly from agent. We need to see what was returned during this scan.

frankbe
Posts: 11
Joined: Thu Jun 13, 2019 2:48 pm
4

Re: Habitat Linux Update Manager shows no Updates

Post by frankbe »

i'm not sure what agent console is - where exactly do i look for the commands output ?

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

Re: Habitat Linux Update Manager shows no Updates

Post by Cubert »

Actually do not bother, I believe I found the issue.

It appears that ConnectWise may have updated the Shell and other script commands functions where now we get execution of a shell but no returns. So if you run in enhanced shell cat /etc/hosts it will no longer return the file output but now just returns "OK" .

So when we try to test to see if execution produced the correct file we get "OK" instead.

I have corrected this in the next build due out ASAP (next 24 to 48hr.) Should be Habitat build 1.0.1.14. We also tweaked the UI a little bit to make it a bit nicer. Here is a sample of the new layout and working collections.

Capture.PNG
Capture.PNG (45.68 KiB) Viewed 1695 times

frankbe
Posts: 11
Joined: Thu Jun 13, 2019 2:48 pm
4

Re: Habitat Linux Update Manager shows no Updates

Post by frankbe »

Great, thank you - looking forward for the new version

But Can you explain where to look at agent console ? It might be useful for other problems .

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

Re: Habitat Linux Update Manager shows no Updates

Post by Cubert »

This is the agent console and you should select the gear and then select either commands or scripts to see the logs for either. This is the heart of how to see and troubleshoot automation tasks.

Capture.PNG
Capture.PNG (139.11 KiB) Viewed 1667 times

frankbe
Posts: 11
Joined: Thu Jun 13, 2019 2:48 pm
4

Re: Habitat Linux Update Manager shows no Updates

Post by frankbe »

ok, thank you - i know this place but log is only

No results were returned, exiting script-> [OK]

I thought there's a more detailed log

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

Re: Habitat Linux Update Manager shows no Updates

Post by Cubert »

Sometime silence speaks volumes!

The fact you received an "OK" actually tells us that the command returned NULL. A NULL value from a command cause Automate to display "OK". If the value was just blank it would be a blank return or if any data or errors exist it should be that.

OK tells us that most likely the command failed to execute at all which is what we started seeing here. The script function called was read file from agent. This should of returned either file not found or file contents but it returned OK instead. So it saw the file but failed to read it. That's an Automate issue and not the plugin. We had to rewrite the script to call different commands before we were able to start retrieving the files again.

So sometimes an OK means so much more if your able to read between the O and the K.

Post Reply

Return to “Habitat”