Page 1 of 2

Nagios has detected a problem with this service ( State: UNK

Posted: Thu Aug 03, 2017 12:42 pm
by lazoo
I need to modify this command by replacing ( " to ' )on all the interface at once,


before the change

check_xi_service_ifoperstatusnag!369099151!-v3 -u IT-SNMPv3User -A "$Password#" -x AES -X "Password" -a MD5 -l authPriv

after the change
check_xi_service_ifoperstatusnag!369099151!-v3 -u IT-SNMPv3User -A '$Password#' -x AES -X 'Password' -a MD5 -l authPriv


I want to be able to change that on all interfaces one time.is that possible?

Re: Nagios has detected a problem with this service ( State:

Posted: Thu Aug 03, 2017 1:27 pm
by bolson
Hello lazoo,

You could write a script around this command:

Code: Select all

sed -i "s/\"/'/g" *


The command will replace all instances of " with ' in the current directory.

Re: Nagios has detected a problem with this service ( State:

Posted: Thu Aug 03, 2017 4:46 pm
by lazoo
I need to apply these changes using bulk tools for all interfaces on the switch
I need help I'm new with Nagios.

Re: Nagios has detected a problem with this service ( State:

Posted: Fri Aug 04, 2017 11:46 am
by dwhitfield
If all your hosts are using the same service, then you only need to change it once.

Can you PM me your Profile so that we can see a bit more about your setup? You can download it by going to Admin > System Config > System Profile and click the ***Download Profile*** button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.

After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.

Re: Nagios has detected a problem with this service ( State:

Posted: Fri Aug 04, 2017 11:49 am
by lazoo
Please check the attached file.

Re: Nagios has detected a problem with this service ( State:

Posted: Fri Aug 04, 2017 12:07 pm
by lazoo
Also, when I receive an email notification its showing port number 34566 for example, instead of the Interface number, I want to receive email showing the interfaces that having problems.

Re: Nagios has detected a problem with this service ( State:

Posted: Fri Aug 04, 2017 2:42 pm
by dwhitfield
The easiest way is going to be to rerun the wizard. That part of the email is being generated from $SERVICEDESC$ so if you want to change that, you need to change the service description.

Re: Nagios has detected a problem with this service ( State:

Posted: Fri Aug 04, 2017 2:55 pm
by lazoo
What should I put into $ARG1$ this will represent interfaces?

Re: Nagios has detected a problem with this service ( State:

Posted: Fri Aug 04, 2017 3:04 pm
by dwhitfield
That is not where you change the email. The email command is as follows: /usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$

As I mentioned before, you will need to change the Service Description (or the email command). Changing the check command will not change the output of the email in the way you want.

Re: Nagios has detected a problem with this service ( State:

Posted: Fri Aug 04, 2017 3:12 pm
by lazoo
I got the email part , I'm talking about applying changes on all interfaces on one host . I'm having an Issue status unknown so the only way to fix this issue is to replace " to " on every single interface.
check_xi_service_ifoperstatusnag!369098781!-v3 -u IT-SNMPv3User -A "$password#" -x AES -X "$password#" -a MD5 -l authPriv

check_xi_service_ifoperstatusnag!369098781!-v3 -u IT-SNMPv3User -A '$password#' -x AES -X '$password#' -a MD5 -l authPriv



I want to use bulk tools to change that on all interfaces.