Skip to content
/ nagrs Public

[WIP] A library to get status and write commands for Nagios.

License

Notifications You must be signed in to change notification settings

k0f1sh/nagrs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[WIP] A library to get status and write commands for Nagios.

Usage

example code

use nagrs::Nagrs;

fn main() {
    let command_file_path = "/usr/local/nagios/var/rw/nagios.cmd";
    let status_file_path = "/usr/local/nagios/var/status.dat";
    let nagrs = Nagrs::new(command_file_path, status_file_path);

    // get nagios status from status.dat
    let nagios_status = nagrs.parse().unwrap();
    println!("{:#?}", nagios_status);

    // write command
    let cmd = nagrs::nagios::cmd::DisableHostgroupHostChecks {
        hostgroup_name: "localhost".to_string(),
    };
    nagrs.write_cmds(&vec![Box::new(cmd)]).unwrap();
}

About

[WIP] A library to get status and write commands for Nagios.

Resources

License

Stars

Watchers

Forks

Languages