diff options
author | Harald Klein <hari@vt100.at> | 2016-10-18 09:48:18 -0400 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2017-02-21 16:07:06 +0000 |
commit | ce4cf2407bbc270472d8cc6fb434e9a1e7f76e38 (patch) | |
tree | 5a9385ddf3fb4390021caa8738a9ad86a8f22c84 | |
parent | 2523ad5013f36bf673b178850d6811151d6ccca3 (diff) | |
download | sos-ce4cf2407bbc270472d8cc6fb434e9a1e7f76e38.tar.gz |
[salt, saltmaster, storageconsole] add plugins for RH Storage Console and salt
Signed-off-by: Harald Klein <hari@vt100.at>
-rw-r--r-- | sos/plugins/salt.py | 42 | ||||
-rw-r--r-- | sos/plugins/saltmaster.py | 40 | ||||
-rw-r--r-- | sos/plugins/storageconsole.py | 63 |
3 files changed, 145 insertions, 0 deletions
diff --git a/sos/plugins/salt.py b/sos/plugins/salt.py new file mode 100644 index 00000000..40dc605d --- /dev/null +++ b/sos/plugins/salt.py @@ -0,0 +1,42 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin + + +class Salt(Plugin, RedHatPlugin, DebianPlugin): + """Salt + """ + + plugin_name = 'salt' + profiles = ('sysmgmt',) + + packages = ('salt',) + + def setup(self): + if not self.get_option("all_logs"): + limit = self.get_option("log_size") + else: + limit = 0 + + if limit: + self.add_copy_spec_limit("/var/log/salt/minion", limit) + else: + self.add_copy_spec("/var/log/salt") + + self.add_copy_spec("/etc/salt") + + self.add_forbidden_path("/etc/salt/pki/*/*.pem") + +# vim: set et ts=4 sw=4 : diff --git a/sos/plugins/saltmaster.py b/sos/plugins/saltmaster.py new file mode 100644 index 00000000..ac5e52ae --- /dev/null +++ b/sos/plugins/saltmaster.py @@ -0,0 +1,40 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin + + +class SaltMaster(Plugin, RedHatPlugin, DebianPlugin): + """Salt Master + """ + + plugin_name = 'saltmaster' + profiles = ('sysmgmt',) + + packages = ('salt-master',) + + def setup(self): + if not self.get_option("all_logs"): + limit = self.get_option("log_size") + else: + limit = 0 + + if limit: + self.add_copy_spec_limit("/var/log/salt/master", limit) + else: + self.add_copy_spec("/var/log/salt") + + self.add_cmd_output("salt-key --list all") + +# vim: set et ts=4 sw=4 : diff --git a/sos/plugins/storageconsole.py b/sos/plugins/storageconsole.py new file mode 100644 index 00000000..9a9c4bcb --- /dev/null +++ b/sos/plugins/storageconsole.py @@ -0,0 +1,63 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin + + +class StorageConsole(Plugin, RedHatPlugin, DebianPlugin): + """Red Hat Storage Console + """ + + plugin_name = 'storageconsole' + profiles = ('storage',) + + packages = ('rhscon-core',) + + def setup(self): + if not self.get_option("all_logs"): + limit = self.get_option("log_size") + else: + limit = 0 + + if limit: + self.add_copy_spec_limit("/var/log/skyring/skyring.log", limit) + self.add_copy_spec_limit("/var/log/skyring/bigfin.log", limit) + self.add_copy_spec_limit("/var/log/carbon/console.log", limit) + self.add_copy_spec_limit("/var/log/graphite-web/info.log", limit) + self.add_copy_spec_limit( + "/var/log/graphite-web/exception.log", + limit + ) + else: + self.add_copy_spec([ + "/var/log/skyring/", + "/var/log/carbon/", + "/var/log/graphite-web/" + ]) + + self.add_copy_spec([ + "/etc/skyring/", + "/etc/carbon/", + "/etc/graphite-web/" + ]) + + self.add_cmd_output( + "mongo skyring --eval 'db.getCollectionNames()'", + suggest_filename="mongo_skyring_collectionnames.txt") + self.add_cmd_output( + "mongo skyring --eval 'DBQuery.shellBatchSize = 10000;" + "db.storage_nodes.find()'", + suggest_filename="mongo_skyring_storagenodes.txt") + +# vim: set et ts=4 sw=4 : |