process_monitor/
process_monitor.rs

1use endpointsecurity_rs::{EsClient, EsEventData, EsEventType};
2
3fn main() {
4    let mut client = EsClient::new().unwrap();
5    client.add_event(EsEventType::NotifyExec).subscribe();
6
7    loop {
8        let msg = client.recv_msg().unwrap();
9        if let Some(ref data) = msg.event_data {
10            match data {
11                EsEventData::NotifyExec(proc) => {
12                    println!("{:?}", proc);
13                }
14                _ => {}
15            }
16        }
17    }
18}