Skip to content

Commit

Permalink
More debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
cholcombe973 committed Sep 19, 2017
1 parent dc8e84d commit 0373105
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/host_information.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ pub struct Host {
impl Host {
pub fn new() -> Result<Self> {
//
debug!("Loading host information");
debug!("Gathering uname info");
let uname_info = uname()?;
let hostname = hostname()?;
let server_type = server_type()?;
let serial_number = server_serial()?;
debug!("Gathering raid info");
let raid_info = block_utils::get_raid_info().map_err(|e| {
Error::new(ErrorKind::Other, e)
})?;
Expand All @@ -43,6 +46,7 @@ impl Host {

/// Find the server hostname
fn hostname() -> Result<String> {
debug!("Gathering hostname info");
let mut buff = String::new();
let mut f = File::open("/etc/hostname")?;
f.read_to_string(&mut buff)?;
Expand All @@ -51,6 +55,7 @@ fn hostname() -> Result<String> {

/// Find the server type
fn server_type() -> Result<String> {
debug!("Gathering server type");
let path = Path::new("/sys/class/dmi/id/product_name");
if Path::exists(path) {
let mut f = File::open(path)?;
Expand All @@ -65,6 +70,7 @@ fn server_type() -> Result<String> {
}

fn server_serial() -> Result<String> {
debug!("Gathering server serial");
// Try the easy way first
debug!("Checking for serial in /sys/class/dmi/id/product_serial");
let path_1 = Path::new("/sys/class/dmi/id/product_serial");
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Details: Disk {} as failed. Please replace if necessary",
host_info.kernel,
);


debug!("Loading ceph backend");
let backend = backend::load_backend(&backend::BackendType::Ceph, Some(Path::new(&config_dir)))?;
info!("Checking all drives");
for result in test_disk::check_all_disks().map_err(|e| e.to_string())? {
Expand Down

0 comments on commit 0373105

Please sign in to comment.