Getting Logs into file
Getting Logs into file
Dear Experts,
currently am using nagios core, and getting logs into file,
in nagios.cfg template is defined as below
host_perfdata_file_template=$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$
service_perfdata_file_template=$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$
am good with this template and format.
but my requirement is i need to get HOST GROUP NAME ,SERVICE GROUP NAME and CONTACT GROUP NAME also in this log for each service or host
, i tried but am not able to get,
Please help me in this regard whether this is possible or need to do any workaround to do, this will be great help.
Regards
Ragu
currently am using nagios core, and getting logs into file,
in nagios.cfg template is defined as below
host_perfdata_file_template=$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$
service_perfdata_file_template=$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$
am good with this template and format.
but my requirement is i need to get HOST GROUP NAME ,SERVICE GROUP NAME and CONTACT GROUP NAME also in this log for each service or host
, i tried but am not able to get,
Please help me in this regard whether this is possible or need to do any workaround to do, this will be great help.
Regards
Ragu
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Getting Logs into file
All available standard macros are listed here
https://assets.nagios.com/downloads/nag ... olist.html
https://assets.nagios.com/downloads/nag ... olist.html
Re: Getting Logs into file
Thank You very much
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Getting Logs into file
glad to be of assistance
Re: Getting Logs into file
hi,
i tried to get below information in log
$CONTACTNAME$
$CONTACTALIAS$
$CONTACTEMAIL$
$CONTACTGROUPNAME$
$CONTACTGROUPNAMES$
am getting null values,
by below command
define command{
command_name process-service-perfdata_test_cont
command_line /bin/echo -e "CONTACTNAME=$CONTACTNAME$|CONTACTALIAS=$CONTACTALIAS$|CONTACTEMAIL=$CONTACTEMAIL$|CONTACTGROUPNAME=$CONTACTGROUPNAME$|CONTACTGROUPNAMES=$CONTACTGROUPNAMES$" >> /usr/local/nagios/var/contact_detail
}
please assist
i tried to get below information in log
$CONTACTNAME$
$CONTACTALIAS$
$CONTACTEMAIL$
$CONTACTGROUPNAME$
$CONTACTGROUPNAMES$
am getting null values,
by below command
define command{
command_name process-service-perfdata_test_cont
command_line /bin/echo -e "CONTACTNAME=$CONTACTNAME$|CONTACTALIAS=$CONTACTALIAS$|CONTACTEMAIL=$CONTACTEMAIL$|CONTACTGROUPNAME=$CONTACTGROUPNAME$|CONTACTGROUPNAMES=$CONTACTGROUPNAMES$" >> /usr/local/nagios/var/contact_detail
}
please assist
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Getting Logs into file
Are you firing this as a notification handler? I ask because the name implies something to do with perfdata, and the Service Perf Data & Host Perf Data columns say no for these macros.ragu6ds wrote:hi,
i tried to get below information in log
$CONTACTNAME$
$CONTACTALIAS$
$CONTACTEMAIL$
$CONTACTGROUPNAME$
$CONTACTGROUPNAMES$
am getting null values,
by below command
please assistCode: Select all
define command{ command_name process-service-perfdata_test_cont command_line /bin/echo -e "CONTACTNAME=$CONTACTNAME$|CONTACTALIAS=$CONTACTALIAS$|CONTACTEMAIL=$CONTACTEMAIL$|CONTACTGROUPNAME=$CONTACTGROUPNAME$|CONTACTGROUPNAMES=$CONTACTGROUPNAMES$" >> /usr/local/nagios/var/contact_detail }
these contact variables are going to be specific to the contact being notified in a notification
Re: Getting Logs into file
Hi,
Yes, trying g to get these details while fetching perf data, for each service who are all the contact person in the log, is it possible?
scottwilkerson
Actually need to get contact information also in each log (like contact person, emails)...Please assist
Yes, trying g to get these details while fetching perf data, for each service who are all the contact person in the log, is it possible?
scottwilkerson
Actually need to get contact information also in each log (like contact person, emails)...Please assist
Last edited by ragu6ds on Tue Apr 10, 2018 8:35 am, edited 1 time in total.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Getting Logs into file
That is not possible.ragu6ds wrote:Hi,
Yes, trying g to get these details while fetching perf data, for each service who are all the contact person in the log, is it possible?
Re: Getting Logs into file
Thank you,
is there any option to get the entire status information and performance data , because while writing into log first and last lines are missing in performance data output $SERVICEPERFDATA$
is there any option to get the entire status information and performance data , because while writing into log first and last lines are missing in performance data output $SERVICEPERFDATA$
Last edited by ragu6ds on Wed Apr 11, 2018 7:11 am, edited 1 time in total.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Getting Logs into file
The current status information is stored in a file called status.datragu6ds wrote:Thank you,
is there any option to get the entire status information into log..please
This is also available in the JSON CGIs
To get started using the CGIs: Browse to the jsonquery.html url in your web browser:
Code: Select all
http://<nagios server>/nagios/jsonquery.html