xref: /openbmc/phosphor-debug-collector/tools/dreport.d/plugins.d/ledgroup (revision 9d26e4fa3d9e5e736c631c81e2981da844825b87)
1*7f8fe7fbSMarri Devender Rao#!/usr/bin/env bash
2*7f8fe7fbSMarri Devender Rao#
3*7f8fe7fbSMarri Devender Rao# config: 2 20
4*7f8fe7fbSMarri Devender Rao# @brief: Collect LED groups details
5*7f8fe7fbSMarri Devender Rao#
6*7f8fe7fbSMarri Devender Rao
7*7f8fe7fbSMarri Devender Rao# shellcheck disable=SC1091
8*7f8fe7fbSMarri Devender Rao. "$DREPORT_INCLUDE"/functions
9*7f8fe7fbSMarri Devender Rao
10*7f8fe7fbSMarri Devender Raodesc="led groups"
11*7f8fe7fbSMarri Devender Rao
12*7f8fe7fbSMarri Devender Raocommand="busctl call --verbose --no-pager \
13*7f8fe7fbSMarri Devender Rao        xyz.openbmc_project.LED.GroupManager \
14*7f8fe7fbSMarri Devender Rao        /xyz/openbmc_project/led/groups \
15*7f8fe7fbSMarri Devender Rao        org.freedesktop.DBus.ObjectManager \
16*7f8fe7fbSMarri Devender Rao        GetManagedObjects"
17*7f8fe7fbSMarri Devender Rao
18*7f8fe7fbSMarri Devender Raofile_name="ledgroups.log"
19*7f8fe7fbSMarri Devender Rao
20*7f8fe7fbSMarri Devender Raoif add_cmd_output "$command" "$file_name" "$desc";
21*7f8fe7fbSMarri Devender Raothen
22*7f8fe7fbSMarri Devender Rao    dir_name="/var/lib/phosphor-led-manager/"
23*7f8fe7fbSMarri Devender Rao    if [ -d "$dir_name" ]; then
24*7f8fe7fbSMarri Devender Rao        add_copy_file "$dir_name" "$desc"
25*7f8fe7fbSMarri Devender Rao    fi
26*7f8fe7fbSMarri Devender Raofi
27