Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ITC-3025 Add tags to CSV export of hosts and services #1528

Merged
merged 2 commits into from
Jul 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
ITC-3025
* Add tags of host or host-template to CSV export.
  • Loading branch information
Jan-Nox committed Jun 26, 2023
commit 337a8c6d4c0e62a12015e114c179c09d87bccac7
7 changes: 7 additions & 0 deletions src/Controller/HostsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2511,12 +2511,18 @@ public function listToCsv() {
$satelliteName = $satellites[$Host->getSatelliteId()];
}

$tags = $Host->getTags();
if (empty($tags)) {
$tags = $Hosttemplate->getTags();
}

$all_hosts[] = [
$Host->getHostname(),
$Host->getId(),
$Host->getUuid(),
$Host->getAddress(),
$Host->getDescription(),
$tags,
$Host->getHosttemplateId(),
$Hosttemplate->getName(),
$Host->getSatelliteId(),
Expand All @@ -2540,6 +2546,7 @@ public function listToCsv() {
'host_uuid',
'host_address',
'host_description',
'host_tags',
'hosttemplate_id',
'hosttemplate_name',
'satellite_id',
Expand Down