summaryrefslogtreecommitdiffstats
path: root/tests/test_discovery.py
Commit message (Collapse)AuthorAgeFilesLines
* autoconfig: avoid renaming hostnames in nagiosRamesh Nachimuthu2014-10-291-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Auto Config tries to use the output of 'hostname' command as a host_name for node in nagios. But if the hostnames are not unique, then it uses IP Address as node_name name in nagios. If after removal of a node, hostnames becomes unique then auto config renames all the host configuration in nagios to their hostnames instead of ip address. It creates multiples issues like removing all the nodes, loss of time series data and unnecessary confusion to the user. Fixing this issue by retaining the perviously configured host names always by going through the host uuid. So if duplication comes after a node addition then only that node will be configured with ip address as host_name but all other existing hosts will not be touched. Similary, even though there is no duplication after the removal of a node with duplicate name, auto config will retain the previously configured hostnames (which are ip addresss becasue there was a hostname duplication earlier) instead of renaming. Change-Id: I0abef47e2e495a591dd3901d2b1766a04c59a701 Bug-Url: https://bugzilla.redhat.com/1139228 Bug-Url: https://bugzilla.redhat.com/1139505 Signed-off-by: Ramesh Nachimuthu <rnachimu@redhat.com> Reviewed-on: http://review.gluster.org/8699 Reviewed-by: darshan n <dnarayan@redhat.com> Reviewed-by: Sahina Bose <sabose@redhat.com>
* autoconfig:mock pynag in auto config test caseRamesh Nachimuthu2014-05-291-3/+1
| | | | | | | | | | | | Mocking pynag using dicts in test cases Change-Id: I7ddedb640910c8dca0b79d17efe5e6eeefc9ee6f Bug-Url: https://bugzilla.redhat.com/1099093 Bug-Url: https://bugzilla.redhat.com/1099328 Signed-off-by: Ramesh Nachimuthu <rnachimu@redhat.com> Reviewed-on: http://review.gluster.org/7921 Reviewed-by: Kanagaraj M <kmayilsa@redhat.com> Reviewed-by: Sahina Bose <sabose@redhat.com>
* autoconfig: refactoring and adding test casesRamesh Nachimuthu2014-05-281-0/+93
| | | | | | | | | | | | Refactoring the code to use constants for repeatedly used strings and add some test case. Change-Id: I7c88231a51ceea3b1cc94223018ecc704b657512 Bug-Url: https://bugzilla.redhat.com/1099093 Bug-Url: https://bugzilla.redhat.com/1099328 Signed-off-by: Ramesh Nachimuthu <rnachimu@redhat.com> Reviewed-on: http://review.gluster.org/7883 Reviewed-by: Sahina Bose <sabose@redhat.com>
* nagios-server-addons: NRPE command with timeoutShubhendu Tripathi2014-05-201-4/+6
| | | | | | | | | | | | | | | | | | | | | | | Introduced a utility method to return a NRPE base command with timeout set externally. Currently if a plugin internally executes NRPE to get the details from the node, there is no mechanism that timeout could be set to more than 10 sec. This method provides the NRPE command with timeout (if passed). This is required for some of the NRPE calls where gluster commands get executed and they might take more time. All the plugins, which execute a NRPE within, can provide optional command line argument for timeout, and same can be used for forming the proper NRPE call with timeout value. Change-Id: Id97624df743664a320a585acc4a85cfcf64d0a07 Signed-off-by: Shubhendu Tripathi <shtripat@redhat.com> Reviewed-on: http://review.gluster.org/7682 Reviewed-by: Sahina Bose <sabose@redhat.com> Tested-by: Sahina Bose <sabose@redhat.com>
* autoconf: don't remove disconnected hosts from nagiosRamesh Nachimuthu2014-05-121-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Currently auto-config removes all the hosts with disconnected status in 'peer status' from nagios configuration. But that is not correct as a host can goto disconnected status for many differnt reasons and we should not remove the configuration. Similarly disconnected hosts need not be added to nagios configuration during auto discovery. Fixing this by ingnoring all the disconnected hosts in delta calculation. Note: Host name can't be used to identify disconnected hosts as we may not be able to communicate the disconnected host to get the host name. Hence Host UUID in peer status is used to intentify the host. Bug-Url: https://bugzilla.redhat.com/1091170 Change-Id: I3fe730d2545f8cbc8224c576712b09bb4c16e712 Signed-off-by: Ramesh Nachimuthu <rnachimu@redhat.com> Reviewed-on: http://review.gluster.org/7677 Reviewed-by: Sahina Bose <sabose@redhat.com>
* autoconf: handle exceptions in nrpe commandsRamesh Nachimuthu2014-05-041-3/+3
| | | | | | | | | Handling the exceptions and failure from NRPE commands. Change-Id: I36cba2d6adf8484ba134ad3f7aec77437ba07857 Signed-off-by: Ramesh Nachimuthu <rnachimu@redhat.com> Reviewed-on: http://review.gluster.org/7659 Reviewed-by: Sahina Bose <sabose@redhat.com>
* autoconf: discover volume list and info separatelyRamesh Nachimuthu2014-05-021-11/+30
| | | | | | | | | | | | | NRPE doesn't support transfering large junk of data as a result. Hence we have to discover the volume details one by one. First fetch the volume list using 'discover_volume_list' NRPE command then fetch the brick details of volume one by one using 'discover_volume_info' NRPE command Change-Id: I2cd3c2309ffa2f1bf5c271e06dd03ade75bf5d92 Signed-off-by: Ramesh Nachimuthu <rnachimu@redhat.com> Reviewed-on: http://review.gluster.org/7631 Reviewed-by: Sahina Bose <sabose@redhat.com>
* autoconf: use host uuid to indentity bricksRamesh Nachimuthu2014-04-291-5/+4
| | | | | | | Using host UUIDs to bricks in host Change-Id: Ie5467b05391f709e292644f00495b41af8213b42 Signed-off-by: Ramesh Nachimuthu <rnachimu@redhat.com>
* autoconf: use host name for host configRamesh Nachimuthu2014-04-291-0/+82
Discover the host name configured for the gluster node and use the same as host_name in nagios host configuration. Change-Id: Ib9eb8b3f3a1a03d1be28fa2faba44c2fc81fa0cf Signed-off-by: Ramesh Nachimuthu <rnachimu@redhat.com>