Sponsored Content
Top Forums Programming Ping test sends mail when ping fails Post 302986315 by RudiC on Wednesday 23rd of November 2016 12:45:12 PM
Old 11-23-2016
The return code of your function is the wrong way: 0 indicates success; 1 (better: anything but 0) indicates error.
And, there's a then missing for the if construct.
And, there might be a logic error: the for loop would work on a list of hosts and return success if any of them would ping.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

PERL: ping and e-mail

I need a script to open a text file with ip's in it, ping them, split the results into the ip and time from the results and e-mail them ? here what i've done. its porbly wrong and not workin.its for win nt4 use Net::SMTP; # get list of ip's to ping open (PINGFILE, "< c:\\Documents and... (20 Replies)
Discussion started by: perleo
20 Replies

2. UNIX for Dummies Questions & Answers

Cron Sends mail to root on completion of job.

All I am running a few scripts through a cron job. This is for checking some key services that are running on by box. The problem is, everytime the cron runs, it sends a mail to the root account. The root account mails need to cleared every now and then. Is there some way I can stop these... (1 Reply)
Discussion started by: skotapal
1 Replies

3. Shell Programming and Scripting

help: infinant loop script - host ping test

need to check on some hosts and send an email if there status changes I wanna put together a script in bash that will allow me to check the up/down state of a single host via ping i want it to run in a continuous loop so I can just fire the script and forget about it(dont want cron to drive... (2 Replies)
Discussion started by: zeekblack
2 Replies

4. Shell Programming and Scripting

PHP Script that sends mail - Postfix breaks it

I have a PHP Script that works perfectly on a server that uses Sendmail. However I tried to port it to a new server that has the Postfix to Sendmail compatibility interface, and it doesn't work properly. The php.ini file has the path for sendmail on both servers set to: /usr/sbin/sendmail -t... (0 Replies)
Discussion started by: boopfm523
0 Replies

5. Shell Programming and Scripting

Running script that sends an html formatted email fails when its run as cronjob

Hi Im very new at working with unix and this problem I simply can not understand. I know there are a lot of threads about problems with shell scripts behaving differently when run from a terminal and from a cronjob. I have tried everything(almost) but I still havent cracked this problem. Im... (15 Replies)
Discussion started by: Nightowl
15 Replies

6. Shell Programming and Scripting

how to know if the mailx command really sends the mail to the email address?

Hi guys, I have a question about the returning message of the mailx command. if I run a mailx command, how can I know if the email has been sent to the email address? If the email address doesn't exist, is there any error message returned? If yes, how can I get the error message? Thanks... (3 Replies)
Discussion started by: sheenshine
3 Replies

7. Shell Programming and Scripting

Animation Ping on Solaris Like Cisco Ping

Hi, I develop simple animation ping script on Solaris Platform. It is like Cisco ping. Examples and source code are below. bash-3.00$ gokcell 152.155.180.8 30 Sending 30 Ping Packets to 152.155.180.8 !!!!!!!!!!!!!.!!!!!!!!!!!!!!!. % 93.33 success... % 6.66 packet loss...... (1 Reply)
Discussion started by: gokcell
1 Replies

8. Shell Programming and Scripting

How to get reason for ping failure using perls Net::Ping->new("icmp");?

Hi I am using perl to ping a list of nodes - with script below : $p = Net::Ping->new("icmp"); if ($p->ping($host,1)){ print "$host is alive.\n"; } else { print "$host is unreacheable.\n"; } $p->close();... (4 Replies)
Discussion started by: tavanagh
4 Replies

9. Homework & Coursework Questions

Creating a function that sends a mail using mail command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: The function will be called m and it will allow you to send an email to someone using the mail command. The... (1 Reply)
Discussion started by: Drucian
1 Replies

10. Shell Programming and Scripting

Ping test using python

I am issuing a reboot command to a client server from admin server using my python function. I am able to do that but now I need do a ping test every second and print if the ping is successful. With the below code I can check ping only once. import os hostname = "myclient" response =... (7 Replies)
Discussion started by: ctrld
7 Replies
secval(1m)																secval(1m)

NAME
secval - A dcecp object that manages the security validation service on a host SYNOPSIS
secval activate [host_name_list] secval deactivate [host_name_list] secval help [operation | -verbose] secval operations secval ping [host_name_list] secval status [host_name_list] secval update [host_name_list] [-pesite time_in_seconds] ARGUMENTS
A list of one or more names of host systems whose security validation systems you want to act on. If you do not specify this argument, the local host is assumed. The argument is optional and takes one of the following forms: hosts/host_name /.:/hosts/host_name /.../cell_name/hosts/host_name The name can also be a single string binding representing the host with which to communicate. For example: {ncacn_ip_tcp 130.105.1.227} A string binding is useful when the name service is not operating and cannot translate the other forms of host names. The name of the sec- val operation for which to display help information. DESCRIPTION
The secval object represents the security validation service running on a host, as part of the dced server. This service is responsible for maintaining the security credentials of the host machine. Access to the commands is based on the access control list (ACL) of the security validation object for a host. This takes the form of /.../cell_name/hosts/host_name/config/secval. OPERATIONS
secval activate Activates a security validation service. The syntax is as follows: secval activate [host_name_list] The activate operation activates a security validation service. If the service is already activated, an error is returned. The optional host_name_list argument is a list of one or more names of host systems whose security validation systems you want to activate. This opera- tion returns an empty string on success. Privileges Required You must have x (execute) permission to the security validation service object. Examples dcecp> secval activate dcecp> dcecp> secval activate ncacn_ip_tcp:15.22.24.145 dcecp> secval deactivate Deactivates a security validation service. The syntax is as follows: secval deactivate [host_name_list] The deactivate operation deactivates a security validation service. If it is already deactivated, an error is returned. The optional host_name_list argument is a list of one or more names of host systems whose security validation systems you want to deactivate. This operation returns an empty string on success. Privileges Required You must have s (stop) permission to the security validation service object. Examples dcecp> secval deactivate dcecp> dcecp> secval deactivate /.:/hosts/gumby dcecp> secval help Returns help information about the secval object and its operations. The syntax is as follows: secval help [operation | -verbose] Options Displays information about the secval object. Used without an argument or option, the secval help command returns brief information about each secval operation. The optional operation argument is the name of an operation about which you want detailed information. Alternatively, you can use the -verbose option for more detailed information about the secval object itself. Privileges Required No special privileges are needed to use the secval help command. Examples dcecp> secval help activate Enables the secval service. deactivate Disables the secval service. ping Contacts the dced secval to validate the security service. status Returns 1 if secval is enabled, 0 if not. update Updates a component of the secval. help Prints a summary of command-line options. operations Returns a list of the valid operations for this command. dcecp> secval operations Returns a list of the operations supported by the secval object. The syntax is as follows: secval operations The list of available operations is in alphabetical order except for help and operations, which are listed last. Privileges Required No special privileges are needed to use the secval operations command. Examples dcecp> secval operations activate deactivate ping status update help operations dcecp> secval ping Validates the credentials returned by a DCE security service. The syntax is as follows: secval ping [host_name_list] The ping operation validates the credentials returned by a security service. This operation can be used to verify that secd is trusted. The operation returns 1 if the credentials are valid, 0 if they are not. The optional host_name_list argument is a list of one or more names of host systems whose security validation systems you want to validate. If the argument is a list of host names, a list is returned with a 1 or a 0 for each server. Privileges Required No special privileges are needed to use the secval ping command. Examples dcecp> secval ping 1 dcecp> dcecp> secval ping /.../pokey_cell/hosts/gumby 1 dcecp> secval status Checks for an active secval. The syntax is as follows: secval status [host_name_list] The status operation returns 1 if the security validation service is activated, 0 if it is not. If the argument is a list, a list is returned, with a 1 or 0 for each server. Privileges Required No special privileges are needed to use the secval status command. Examples dcecp> secval status 1 dcecp> dcecp> secval status ncacn_ip_tcp:15.22.24.145 1 dcecp> secval update Updates a component of the secval service. The syntax is as follows: secval update [host_name_list] [-pesite time_in_seconds] Options Sets the amount of time to wait between each pe_site Thread Maintenance update. The update operation updates a component of the security validation service. Currently only updates to the pe_site Maintainer Thread are supported. Use the -pesite option to set the amount of time in seconds between each update. The update is performed after the time speci- fied in time_in_seconds passes. If the -pesite option is not supplied, the update is performed immediately. This operation returns an empty string on success. Privileges Required You must have x (execute) permission to the security validation service object. Examples dcecp> secval update -pesite 300 dcecp> RELATED INFORMATION
Commands: dcecp(1m), dced(1m). secval(1m)
All times are GMT -4. The time now is 07:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy