Skip to content

Commit 154af65

Browse files
committed
[getent] New plugin draft
Signed-off-by: Pablo Fernández Rodríguez <pafernan@redhat.com>
1 parent 23f46d1 commit 154af65

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

sos/report/plugins/getent.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file is part of the sos project: https://github.com/sosreport/sos
2+
#
3+
# This copyrighted material is made available to anyone wishing to use,
4+
# modify, copy, or redistribute it subject to the terms and conditions of
5+
# version 2 of the GNU General Public License.
6+
#
7+
# See the LICENSE file in the source distribution for further information.
8+
9+
from sos.report.plugins import IndependentPlugin
10+
from sos.report.plugins import Plugin
11+
12+
13+
class Getent(Plugin, IndependentPlugin):
14+
15+
short_desc = 'query Name Service Switch (NSS) databases'
16+
17+
plugin_name = "getent"
18+
profiles = ('system',)
19+
verify_packages = ('glibc-common', 'libc-bin', 'glibc')
20+
21+
def setup(self):
22+
23+
# For reference. This databases are not collected.
24+
# ["ahosts", "ahostsv4", "ahostsv6", "ethers", "gshadow", "hosts",
25+
# "networks", "passwd", "services", "shadow"]
26+
27+
# Collected databases
28+
databases = ["aliases", "group", "netgroup", "protocols", "rpc"]
29+
30+
for db in databases:
31+
self.add_cmd_output(f"getent {db}")
32+
33+
# vim: set et ts=4 sw=4 :

0 commit comments

Comments
 (0)