Marco for Operating system

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ranjitw
Posts: 175
Joined: Tue Sep 01, 2015 1:52 am

Marco for Operating system

Post by ranjitw »

Hi ,

Do we have a macro for getting Operating system ?

I could not find it in https://assets.nagios.com/downloads/nag ... olist.html
Regards,
Ranjit W
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Marco for Operating system

Post by tmcdonald »

We don't have a macro for this. In what context are you looking to get the OS? If it's a script you can use some bash/shell tricks on most OSes to get this.
Former Nagios employee
ranjitw
Posts: 175
Joined: Tue Sep 01, 2015 1:52 am

Re: Marco for Operating system

Post by ranjitw »

Hi ,

I have integrated nagios with BEM as part of msend command I am sending macros and would need OS details to be sent as well .
Regards,
Ranjit W
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Marco for Operating system

Post by jdalrymple »

I don't know how you'd go about turning that into an env on every check autonomously. You could definitely use a custom object variable for it though, would just require maintenance.
ranjitw
Posts: 175
Joined: Tue Sep 01, 2015 1:52 am

Re: Marco for Operating system

Post by ranjitw »

Hi,

We have macro for host group so I have mapped the host to the relavent host group . BEM is identifying the server type based on the host group and doing further processing.

Thanks for the custom variable link but I am not getting an idea of how it can be used in our scenario . Are you suggesting to explicitily mention the OS details and assign it to custom variable ?
Regards,
Ranjit W
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Marco for Operating system

Post by tmcdonald »

Being used as a macro, you will almost certainly need to hard-code the OS into a custom variable and use that macro. The difficulty arises from the fact that there is not a great way to tell what OS a remote machine is in an automated fashion, with a great degree of accuracy. You can get some guesses, but that relies on scanning for ports and seeing how the machine responds, which would be heavy if needed on-demand. The hostgroup trick is also nice as it lets you avoid the use of custom variables, and provides more utility (since you can issue commands based on a group, but not based on custom variable contents).
Former Nagios employee
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Marco for Operating system

Post by Box293 »

Alternatively you could have an operating system service and send the status output of that service in the msend command (this should be available by using an on demand macro).

I have some examples here:
http://sites.box293.com/nagios/guides/c ... ing-system
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked