Re: [Nagios-users] Acknowledged by user + Service action url
That worked great, thanks much for your help! PJ -Original Message- From: Marc Powell [mailto:m...@ena.com] Sent: Thursday, January 15, 2009 2:53 PM To: nagios-users Mailinglist Subject: Re: [Nagios-users] Acknowledged by user + Service action url On Jan 15, 2009, at 12:51 PM, Palle L Jensen wrote: Marc, Thanks for you help!! I am half way there :=) Good deal. You are right I have been unable to add the action url in the service definition, due to I have several hostnames for the specific service check. For example the below DiskE check I have several hosts defined for that check, how would I go by to replace johndoehost so the link will be correct? http://1xx.xx.xxx.xxx/nagios/cgi- bin/extinfo.cgi?type=2host=johndoehostser vice=DiskE http://nagios.sourceforge.net/docs/3_0/macros.html Macro Substitution - How Macros Work Before Nagios executes a command, it will replace any macros it finds in the command definition with their corresponding values. This macro substitution occurs for all types of commands that Nagios executes - host and service checks, notifications, event handlers, etc. Certain macros may themselves contain other macros. These include the $HOSTNOTES$, $HOSTNOTESURL$, $HOSTACTIONURL$, $SERVICENOTES$, $SERVICENOTESURL$, and $SERVICEACTIONURL$ macros. In your case, I expect the following should work -- define service { ... action_urlhttp://1xxx.xx.xxx.xxx/nagios/cgi- bin/extinfo.cgi?type=2host=$HOSTNAME$service=DiskE ... } -- Marc -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Acknowledged by user + Service action url {Fraud?}
On Jan 15, 2009, at 8:28 AM, Palle L Jensen wrote: Hello, I have 2 problems that I am currently working on. 1. In Nagios Web-interface and when someone acknowledges a problem, the Author (your name) it is pre-populated with “Nagios” and cannot be changed. We would like to be able to populate that with operators that acknowledge the problem. - I have looked around on settings and permissions but can’t find any solution. http://nagios.sourceforge.net/docs/3_0/configcgi.html Lock Author Names Format: lock_author_names=[0/1] Example:lock_author_names=1 This option allows you to restrict users from changing the author name when submitting comments, acknowledgements, and scheduled downtime from the web interface. If this option is enabled, users will be unable to change the author name associated with the command request. * 0 = Allow users to change author names when submitting commands * 1 = Prevent users from changing author names (default) 2. I wanted to have service action url in the acknowledge notes being sent to operators from Nagios. The host action url works fine, but for the service it does not populate the url in the notes. - Below is how my commands look. -- For service – this does not work with action url: --- notify-service-by-email /usr/bin/printf %b * CCO Nagios Monitoring 3.0.1 *\n\nNotification Type: $NOTIFICATIONTYPE$\n \nDate/Time: $LONGDATETIME$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n \nOperator: $SERVICEACKAUTHOR$\nComment: $SERVICEACKCOMMENT$\nUrl: $SERVICEACTIONURL$\nInfo:\n$SERVICEOUTPUT$ | /usr/bin/mail -s ** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ ** $CONTACTEMAIL$ It does look like you're using the correct(ly spelled) macro. Are you sure that the service definition has action_url specified? Can you post it? I'd also enable debug mode in nagios.cfg and see if anything interesting showed up. -- Marc -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Acknowledged by user + Service action url
From: Palle L Jensen [mailto:pall...@gmail.com] Sent: Thursday, January 15, 2009 9:28 AM To: nagios-users@lists.sourceforge.net Subject: [Nagios-users] Acknowledged by user + Service action url 1. In Nagios Web-interface and when someone acknowledges a problem, the Author (your name) it is pre-populated with Nagios and cannot be changed. We would like to be able to populate that with operators that acknowledge the problem. As far as I know, that field is automatically populated through some alignment of the users being set up as contacts within Nagios, those contacts being set up in cgi.cfg, and having access set up through htpasswd.users. I kept the user name in htpasswd.users the same as the contact_name in contacts.cfg, and the $NOTIFICATIONAUTHORALIAS$ macro got correctly set to the user's contact alias (where I put their full name). It all worked for me the first time I tried it, so I didn't get any experience fixing any wrong-ness, though. Nothing in this message is intended to make or accept and offer or to form a contract, except that an attachment that is an image of a contract bearing the signature of an officer of our company may be or become a contract. This message (including any attachments) is intended only for the use of the individual or entity to whom it is addressed. It may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute as attorney work product. If you are not the intended recipient, we hereby notify you that any use, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this message in error, please notify us immediately by telephone and delete this message immediately. Thank you. -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Acknowledged by user + Service action url{Fraud?}
Marc, Thanks for you help!! I am half way there :=) 1. http://nagios.sourceforge.net/docs/3_0/configcgi.html Lock Author Names Format: lock_author_names=[0/1] Example: lock_author_names=1 That worked great, Recently was looking for something like this in the cgi.cfg but never found the commands. I guess I should have looked closer in the manual (http://nagios.sourceforge.net/docs/3_0/configcgi.html) cause that made all sense. Adding that to the cgi.cfg worked perfect. 2. It does look like you're using the correct(ly spelled) macro. Are you sure that the service definition has action_url specified? Can you post it? I'd also enable debug mode in nagios.cfg and see if anything interesting showed up. You are right I have been unable to add the action url in the service definition, due to I have several hostnames for the specific service check. For example the below DiskE check I have several hosts defined for that check, how would I go by to replace johndoehost so the link will be correct? http://1xx.xx.xxx.xxx/nagios/cgi-bin/extinfo.cgi?type=2host=johndoehostser vice=DiskE Thanks, PJ -Original Message- From: Marc Powell [mailto:m...@ena.com] Sent: Thursday, January 15, 2009 10:38 AM To: nagios-users Mailinglist Subject: Re: [Nagios-users] Acknowledged by user + Service action url{Fraud?} On Jan 15, 2009, at 8:28 AM, Palle L Jensen wrote: Hello, I have 2 problems that I am currently working on. 1. In Nagios Web-interface and when someone acknowledges a problem, the Author (your name) it is pre-populated with Nagios and cannot be changed. We would like to be able to populate that with operators that acknowledge the problem. - I have looked around on settings and permissions but can't find any solution. http://nagios.sourceforge.net/docs/3_0/configcgi.html Lock Author Names Format: lock_author_names=[0/1] Example: lock_author_names=1 This option allows you to restrict users from changing the author name when submitting comments, acknowledgements, and scheduled downtime from the web interface. If this option is enabled, users will be unable to change the author name associated with the command request. * 0 = Allow users to change author names when submitting commands * 1 = Prevent users from changing author names (default) 2. I wanted to have service action url in the acknowledge notes being sent to operators from Nagios. The host action url works fine, but for the service it does not populate the url in the notes. - Below is how my commands look. -- For service - this does not work with action url: --- notify-service-by-email /usr/bin/printf %b * CCO Nagios Monitoring 3.0.1 *\n\nNotification Type: $NOTIFICATIONTYPE$\n \nDate/Time: $LONGDATETIME$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n \nOperator: $SERVICEACKAUTHOR$\nComment: $SERVICEACKCOMMENT$\nUrl: $SERVICEACTIONURL$\nInfo:\n$SERVICEOUTPUT$ | /usr/bin/mail -s ** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ ** $CONTACTEMAIL$ It does look like you're using the correct(ly spelled) macro. Are you sure that the service definition has action_url specified? Can you post it? I'd also enable debug mode in nagios.cfg and see if anything interesting showed up. -- Marc -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Acknowledged by user + Service action url
On Jan 15, 2009, at 12:51 PM, Palle L Jensen wrote: Marc, Thanks for you help!! I am half way there :=) Good deal. You are right I have been unable to add the action url in the service definition, due to I have several hostnames for the specific service check. For example the below DiskE check I have several hosts defined for that check, how would I go by to replace johndoehost so the link will be correct? http://1xx.xx.xxx.xxx/nagios/cgi-bin/extinfo.cgi?type=2host=johndoehostser vice=DiskE http://nagios.sourceforge.net/docs/3_0/macros.html Macro Substitution - How Macros Work Before Nagios executes a command, it will replace any macros it finds in the command definition with their corresponding values. This macro substitution occurs for all types of commands that Nagios executes - host and service checks, notifications, event handlers, etc. Certain macros may themselves contain other macros. These include the $HOSTNOTES$, $HOSTNOTESURL$, $HOSTACTIONURL$, $SERVICENOTES$, $SERVICENOTESURL$, and $SERVICEACTIONURL$ macros. In your case, I expect the following should work -- define service { ... action_url http://1xxx.xx.xxx.xxx/nagios/cgi-bin/extinfo.cgi?type=2host=$HOSTNAME$service=DiskE ... } -- Marc -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null