Sponsored Content
Full Discussion: alarms
Top Forums Shell Programming and Scripting alarms Post 85131 by run_time_error on Sunday 2nd of October 2005 08:44:16 AM
Old 10-02-2005
alarms

Hi

I have been trying to set up alarms on my Solaris box (Sun OS 5.8)
The objective is to present the user an audible alarm every hour or so.
I have so far done this:

Code:
#!/bin/sh
val=1
while [ $val -lt 30 ]
do
   printf "\a"
   val=`expr $val + 1`
done

I have put this in my crontab to run hourly.
So far I get nothing. Where am I wrong??

rte
 

9 More Discussions You Might Find Interesting

1. Solaris

Alarms/Alerts

Is there a imbedded command (Solaris v8 ksh) that will send an administrative alert/alarm. Or is it just triggering a mail message via shell script? If no, is there a good open-source code someone knows about? Thanks so much in advance for any replies. ...Gozer13 (3 Replies)
Discussion started by: gozer13
3 Replies

2. UNIX for Dummies Questions & Answers

Autosys Email Alarms

Hello, I'm kind of new to autosys, but I'm assuming there is a way to have Alarms be emailed instead of having to run jobscape and click the Alarm button to see what jobs have failed? Does anyone have an insight onto how this can be done? Thanks. (14 Replies)
Discussion started by: rpiller
14 Replies

3. Infrastructure Monitoring

Sun Solaris 9 Traps Contain Multiple Alarms

Hi all, I have a Sun Solaris 9 box which acts as a firewall. Sometimes if multiple actions which cause snmp traps occur very close together, a single snmp trap that is sent containing the text for multiple alarms. I would like to prevent that and have a trap sent for each action which would... (0 Replies)
Discussion started by: g0ld2k
0 Replies

4. Solaris

lp serverlist alarms in messages

Hello, I have been receiving following alarms in /var/adm/messages dtcp: WARNING DB (db_tcp.c,363) db_alloc_connid: lp && lp->serverlist error for service 20 It seems like this message is related to LP print service. Since I am not using any print service, is there any way to switch it... (2 Replies)
Discussion started by: aalishan
2 Replies

5. Solaris

Hardware Alarms on HP-ux Solarisx86

Hi I am trying to configure the Hardware alarms on HP server. I have refer to "HP ProLiant Health Monitor User Guide" and installed HPQacucli-3.5.0-solaris10-i386 HPQhealth-4.4.0-solaris10-i386 HPQhma-5.7.0-solaris10-i386 HPQilo-1.4.5-solaris10-i386 HPQsmh-5.5.0-solaris10-i386 ... (2 Replies)
Discussion started by: anand87
2 Replies

6. Solaris

Strange power supply units alarms!!!

Hi folks, I encountered this alarms on a solaris server: 04/21/12 23:17:55 MNP-PGW-A_bge3 mnp 231748 Power Supply Unit 0 is faulty 04/21/12 23:17:55 MNP-PGW-A_bge3 mnp 231748 Power Supply Unit 1 is faulty 04/21/12 23:18:26 MNP-PGW-A_bge3 mnp 231822 Power Supply Unit 0 is faulty:CLEAR... (0 Replies)
Discussion started by: kimurayuki
0 Replies

7. Solaris

Ftpd alarms

Hi, I am facing following alarms in var/adm/messages after an interval of 10 mins. I dont know what the impact is and how can i fix it. Can anyone help please? Dec 4 07:50:03 hxcsvc-a01 ftpd: open_module: stat(/usr/lib/security/pam_unix_session.so.1) failed: No such file or directory Dec ... (4 Replies)
Discussion started by: sni_engineer
4 Replies

8. Solaris

Sudden Service Busy Alarms

Hi, I am getting service busy alarms on my machines which are using MongoDB every now and then. When the service busy alarm appears, I get the following errors on my mongo router logs. Tue Apr 7 08:01:08.445 dbclient_rs nodes.ok = true hxcslc-b05:27014 Tue Apr 7 08:01:08.445 dbclient_rs... (0 Replies)
Discussion started by: sni_engineer
0 Replies

9. UNIX for Beginners Questions & Answers

CentOs server generating several alarms on partition /proc/

Greetings, I have been facing one issue here and I am not understanding what is causing. I am getting a lot of alarms complaining that the partition for example /proc/12345 , is full, but the partition does not existe on the server. Which is not supposed to happen, because /proc is not a real... (10 Replies)
Discussion started by: Yagami_Sama
10 Replies
SNMP_ALARM(3)							     Net-SNMP							     SNMP_ALARM(3)

NAME
snmp_alarm_register, snmp_alarm_register_hr, snmp_alarm_unregister - alarm functions SYNOPSIS
#include <net-snmp/utilities.h> unsigned int snmp_alarm_register(unsigned int seconds, unsigned int flags, SNMPAlarmCallback *f_callback, void *clientarg); unsigned int snmp_alarm_register_hr(struct timeval t, unsigned int flags, SNMPAlarmCallback *f_callback, void *clientarg); void snmp_alarm_unregister(unsigned int reg); DESCRIPTION
These functions implement support for a generic timer handling mechanism for multiple parts of an application to register function call- backs to happen at a particular time in the future. USAGE
The usage is fairly simple and straight-forward: Simply create a function you want called back at some point in the future. The function definition should be similar to: void my_callback(unsigned int reg, void *clientarg); Then, call snmp_alarm_register() to register your callback to be called seconds from now. The flags field should either be SA_REPEAT or NULL. If flags is set with SA_REPEAT, then the registered callback function will be called every seconds. If flags is NULL then the func- tion will only be called once and then removed from the alarm system registration. The clientarg parameter in the registration function is used only by the client function and is stored and passed back directly to them on every call to the system. The snmp_alarm_register() function returns a unique unsigned int (which is also passed as the first argument of each callback), which can then be used to remove the callback from the queue at a later point in the future using the snmp_alarm_unregister() function. If the snmp_alarm_register() call fails it returns zero. In particular, note that it is entirely permissible for an alarm function to unregister itself. The snmp_alarm_register_hr() function is identical in operation to the snmp_alarm_register() function, but takes a struct timeval as a first parameter, and schedules the callback after the period represented by t (the letters hr stand for "high resolution"). The operation of this function is dependent on the provision of the setitimer(2) system call by the operating system. If this system call is not avail- able, the alarm will be scheduled as if snmp_alarm_register() had been called with a first argument equal to the value of the tv_sec member of t. See, however, the notes below. INITIALIZATION
The init_snmp() function initialises the snmp_alarm subsystem by calling init_snmp_alarm() and then init_alarm_post_config() to set up the first timer to initialise the callback function. These two functions should not be used directly by applications. NOTES
The default behaviour of the snmp_alarm subsystem is to request SIGALRM signals from the operating system via the alarm(2) or setitimer(2) system calls. This has the disadvantage, however, that no other part of the application can use the SIGLARM functionality (or, if some other part of the application does use the SIGALRM functionality, the snmp_alarm subsystem will not work correctly). If your application runs a select(2)-based event loop, however, there is no need to use SIGALRM for the snmp_alarm subsystem, leaving it available for other parts of the application. This is done by making the following call: netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_ALARM_DONT_USE_SIG, 1); before calling init_snmp(). Then, snmp_select_info() takes alarms into account when calculating the timeout value to be used for select(2). All you need to do is call run_alarms() when select(2) times out (return value of zero). This is the approach taken in the agent; see snmpd.c. Furthermore, when using this method, high resolution alarms do not depend on the presence of the setitimer(2) system call, although overall precision is of course still determined by the underlying operating system. Recommended. SEE ALSO
netsnmp_session_api(3), default_store(3), alarm(2), setitimer(2), select(2) V5.7.2 01 Aug 2002 SNMP_ALARM(3)
All times are GMT -4. The time now is 06:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy