pagerduty cron job doesn't update proxy when proxy IP is changed

Bug #1989032 reported by Linda Guo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Nagios Charm
In Progress
Medium
Aliaksandr Vasiuk

Bug Description

Nagios gets proxy IP from environment variable. When proxy is changed, pagetduty cron job (/etc/cron.d/nagios-pagerduty-flush) is not updated

        proxy = env.get("JUJU_CHARM_HTTPS_PROXY") or env.get("https_proxy")
        proxy_switch = "--proxy {}".format(proxy) if proxy else ""

Linda Guo (lihuiguo)
Changed in charm-nagios:
status: New → Confirmed
importance: Undecided → Medium
summary: - nagios pagerduty cron job doesn't update when proxy IP is changed
+ pagerduty cron job doesn't update proxy when proxy IP is changed
Changed in charm-nagios:
assignee: nobody → Aliaksandr Vasiuk (valexby)
Changed in charm-nagios:
status: Confirmed → In Progress
Revision history for this message
Aliaksandr Vasiuk (valexby) wrote :

Hey Linda, thanks for reporting the issue! Would you elaborate on the expected behavior?
That how I tried to set proxy for pagerduty and seems like it works for me
1. I deployed charm-nagios revision 49
2. Did `juju config central-monitor enable_pagerduty=true`
3. Checked that no --proxy switch in `/etc/cron.d/nagios-pagerduty-flush`
 $ cat /etc/cron.d/nagios-pagerduty-flush
 #------------------------------------------------
 # This file is juju managed
 #------------------------------------------------

 # Flush the nagios pagerduty alerts every minute as per
 # http://www.pagerduty.com/docs/guides/nagios-perl-integration-guide/
 * * * * * nagios /usr/local/bin/pagerduty_nagios.pl flush --queue-dir /var/lib/nagios3 /pagerduty
4. Then set proxy for juju `juju model-config juju-https-proxy=http://squid.internal:3128`
5. Disabled and enabled pagerduty to reconfigure it:
 $ juju config central-monitor enable_pagerduty=false
 $ juju config central-monitor enable_pagerduty=true
6. Once charm is ready check pagerduty cronjob again
 $ cat /etc/cron.d/nagios-pagerduty-flush
 #------------------------------------------------
 # This file is juju managed
 #------------------------------------------------

 # Flush the nagios pagerduty alerts every minute as per
 # http://www.pagerduty.com/docs/guides/nagios-perl-integration-guide/
 * * * * * nagios /usr/local/bin/pagerduty_nagios.pl flush --proxy http://squid.internal:3128 --queue-dir /var/lib/nagios3/pagerduty

As you see the --proxy switch is added to the cronjob configuration.
Maybe I'm reproducing it in the wrong way. Should I set JUJU_CHARM_HTTPS_PROXY somehow another way? Or should the charm be reconfigured right after `juju model-config juju-https-proxy=http://squid.internal:3128` without manipulations with the charm configuration (maybe in such a case makes sense to add proxy to charm's configurable params list...)
I am looking forward to your reply!

Revision history for this message
Aliaksandr Vasiuk (valexby) wrote :

[Giuseppe](https://code.launchpad.net/~peppepetra) told me that it would be nice to have proxy for the cronjob be reconfigured after proxy for the juju model is updated. So no concerns from me now, Linda. I proceed with the bug, thanks!

Revision history for this message
Linda Guo (lihuiguo) wrote :

Hi

Do you mean user need to re-enable 'enable_pagerduty' when they changed the proxy config in juju model-config?

I filed this bug because I found when juju-https-proxy/juju-http-proxy is changed in juju model-config, nagios cron job is not updated

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.