snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11.12k stars 3.19k forks source link

Check in Asset to Asset. Change of Location. #7938

Open Bessonata opened 4 years ago

Bessonata commented 4 years ago

Hello, I assign one asset to another, for Example Monitor to a Laptop (Check out asset -> asset ->Location). But when I check in the "main" asset to another location, the location of the assigned asset remains the same and has to be changed manually. Another problem: I go to a tab "assets" of the "main" asset - there are shown all the assigned assets, but from there it is not possible to bulk all of them to change the Location: system automatically goes to a "main" asset's details tab with a notification "Error: no asset selected" Could the problem be solved somehow? Thank you in advance!

gmintoco commented 4 years ago

Hello I am also having the same issue. This is on Snipe-IT Version v4.9.0 - build 4210 running on Docker in K8s

When an asset (A) is checked out to another asset (B) and then asset (B) is checked out to a location the location of Asset (A) in this case is unchanged. This has applications when tracking assets that are considered to a part of another assert (e.g. A network card in a computer) when the computer changes location it seems logical the other asset should too. Thanks :)

gmintoco commented 4 years ago

I have some context to add to this issue. This is all done on a clean installation of Snipe-IT. When running php artisan snipeit:sync-asset-locations --output=all the locations are corrected but they do not update properly when checking assets out via the bulk method or the normal method

gmintoco commented 4 years ago

I was planning on trying to mitigate this by creating a cron job to run the sync-asset-locations command every so often however the cron job fails with the following:

  PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or s
  ervice not known
gmintoco commented 4 years ago

I have found a workaround for anyone that stumbles upon this. A fix would be the best solution but in the meantime you can modify app/Console/Kernel.php and add the line $schedule->command('snipeit:snipeit:sync-asset-locations')->everyFiveMinutes(); under all of the other lines that look similar (line no 28) I wasn't sure if snipe-it had a cronjob for triggering the laravel schedular built in but you can create one quite easily. Just add this line to your crontab * * * * * cd /var/www/html && php artisan schedule:run >> /dev/null 2>&1 - this fix is working for me as of v4.9.0

Threnklyn commented 4 years ago

In the docker images is a supervisor process which runs /var/www/html/artisan schedule:run every minute. So you don't need to add a line to crontab. Your line looks wrong. It should be $schedule->command('snipeit:sync-asset-locations')->everyFiveMinutes(); Just one snipeit:

gmintoco commented 4 years ago

Ah okay thanks I think that was just an issue in my copy paste I have in my crontab $schedule->command('snipeit:sync-asset-locations')->everyFiveMinutes(); good to know about the supervisor process i can remove that line from cron thanks

eitler-terra commented 4 years ago

Hi there is an existing issue for this with a bit of a workaround #7938

Thank's for the information, and for the workaround! Do you know if there are any plans to fix this in a future release? It seems a bit "heavy" to update the locations of all Assets every 5 Minutes, while there are mostly just a few assets that changed their location.

gmintoco commented 4 years ago

@eitler-terra you're welcome :) I have absolutely no idea, I am just a user of snipeit. It does seem a bit too heavy to me and not an ideal solution by any means. So definitely in agreement with you there.

stale[bot] commented 4 years ago

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

gmintoco commented 4 years ago

Yeah still relevant

On Sun, 2 Aug 2020, 04:46 stale[bot], notifications@github.com wrote:

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/snipe/snipe-it/issues/7938#issuecomment-667572288, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMCHXCHZTBNOXBL2CRWSINLR6RPJVANCNFSM4L2RJ3FA .

stale[bot] commented 4 years ago

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

stale[bot] commented 4 years ago

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

Jaspotn0612 commented 4 years ago

Yes

stale[bot] commented 4 years ago

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

justinotherguy commented 4 years ago

still relevant :)

stale[bot] commented 3 years ago

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

justinotherguy commented 3 years ago

Hello stale bot, yes, this is still relevant. Thanks for asking :)

stale[bot] commented 3 years ago

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!